Re: [PATCH] btrfs: Correct printing of sector_t

Previous thread: [PATCH] ath9k: hif_usb: Reduce indent 1 column by Joe Perches on Tuesday, November 30, 2010 - 1:19 pm. (1 message)

Next thread: [PATCH/RFC] jump label: make enable/disable o(1) by Jason Baron on Tuesday, November 30, 2010 - 1:36 pm. (3 messages)
From: Geert Uytterhoeven
Date: Tuesday, November 30, 2010 - 1:30 pm

If CONFIG_LBDAF=y, `sector_t' becomes `u64' instead of `unsigned long':

fs/btrfs/inode.c: In function ‘btrfs_end_dio_bio’:
fs/btrfs/inode.c:5717: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 4 has type ‘sector_t’

Hence always cast it to `unsigned long long' for printing.

Introduced by commit e65e1535542931e51189832264cd282e5899e4b9 ("btrfs: fix
panic caused by direct IO")

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 fs/btrfs/inode.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 8039390..fbffe5f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5712,9 +5712,9 @@ static void btrfs_end_dio_bio(struct bio *bio, int err)
 
 	if (err) {
 		printk(KERN_ERR "btrfs direct IO failed ino %lu rw %lu "
-		      "disk_bytenr %lu len %u err no %d\n",
-		      dip->inode->i_ino, bio->bi_rw, bio->bi_sector,
-		      bio->bi_size, err);
+		      "disk_bytenr %llu len %u err no %d\n",
+		      dip->inode->i_ino, bio->bi_rw,
+		      (unsigned long long)bio->bi_sector, bio->bi_size, err);
 		dip->errors = 1;
 
 		/*
-- 
1.7.0.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
--

From: Randy Dunlap
Date: Tuesday, November 30, 2010 - 1:33 pm

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--

From: Li Zefan
Date: Tuesday, November 30, 2010 - 6:33 pm

While we are at this..

===================

[PATCH] btrfs: Fix compile warning when CONFIG_MIGRATION is not set

Fix this newly introduced warning:

fs/btrfs/disk-io.c:699: warning: 'btree_migratepage' defined but not used

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 fs/btrfs/disk-io.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 33b6d45..7648247 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -696,6 +696,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
 				   __btree_submit_bio_done);
 }
 
+#ifdef CONFIG_MIGRATION
 static int btree_migratepage(struct address_space *mapping,
 			struct page *newpage, struct page *page)
 {
@@ -712,12 +713,10 @@ static int btree_migratepage(struct address_space *mapping,
 	if (page_has_private(page) &&
 	    !try_to_release_page(page, GFP_KERNEL))
 		return -EAGAIN;
-#ifdef CONFIG_MIGRATION
+
 	return migrate_page(mapping, newpage, page);
-#else
-	return -ENOSYS;
-#endif
 }
+#endif
 
 static int btree_writepage(struct page *page, struct writeback_control *wbc)
 {
-- 
1.6.3

--

Previous thread: [PATCH] ath9k: hif_usb: Reduce indent 1 column by Joe Perches on Tuesday, November 30, 2010 - 1:19 pm. (1 message)

Next thread: [PATCH/RFC] jump label: make enable/disable o(1) by Jason Baron on Tuesday, November 30, 2010 - 1:36 pm. (3 messages)