linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: Correct printing of sector_t
@ 2010-11-30 20:30 Geert Uytterhoeven
  2010-11-30 20:33 ` Randy Dunlap
  2010-12-01  1:33 ` Li Zefan
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2010-11-30 20:30 UTC (permalink / raw)
  To: Miao Xie, Chris Mason
  Cc: linux-btrfs, Linux Kernel Development, Andrew Morton

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

fs/btrfs/inode.c: In function =A1btrfs_end_dio_bio=A2:
fs/btrfs/inode.c:5717: warning: format =A1%lu=A2 expects type =A1long u=
nsigned int=A2, but argument 4 has type =A1sector_t=A2

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, in=
t err)
=20
 	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 =3D 1;
=20
 		/*
--=20
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=
=2E But
when I'm talking to journalists I just say "programmer" or something li=
ke that.
							    -- Linus Torvalds

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Correct printing of sector_t
  2010-11-30 20:30 [PATCH] btrfs: Correct printing of sector_t Geert Uytterhoeven
@ 2010-11-30 20:33 ` Randy Dunlap
  2010-12-01  1:33 ` Li Zefan
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2010-11-30 20:33 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Miao Xie, Chris Mason, linux-btrfs, Linux Kernel Development,
	Andrew Morton

On Tue, 30 Nov 2010 21:30:01 +0100 (CET) Geert Uytterhoeven wrote:

> If CONFIG_LBDAF=3Dy, `sector_t' becomes `u64' instead of `unsigned lo=
ng':
>=20
> fs/btrfs/inode.c: In function =E2=80=98btrfs_end_dio_bio=E2=80=99:
> fs/btrfs/inode.c:5717: warning: format =E2=80=98%lu=E2=80=99 expects =
type =E2=80=98long unsigned int=E2=80=99, but argument 4 has type =E2=80=
=98sector_t=E2=80=99
>=20
> Hence always cast it to `unsigned long long' for printing.
>=20
> Introduced by commit e65e1535542931e51189832264cd282e5899e4b9 ("btrfs=
: fix
> panic caused by direct IO")
>=20
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>


> ---
>  fs/btrfs/inode.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>=20
> 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)
> =20
>  	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 =3D 1;
> =20
>  		/*
> --=20
> 1.7.0.4
>=20
> Gr{oetje,eeting}s,
>=20
> 						Geert
>=20
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linu=
x-m68k.org
>=20
> In personal conversations with technical people, I call myself a hack=
er. But
> when I'm talking to journalists I just say "programmer" or something =
like that.
> 							    -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kerne=
l" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your cod=
e ***

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Correct printing of sector_t
  2010-11-30 20:30 [PATCH] btrfs: Correct printing of sector_t Geert Uytterhoeven
  2010-11-30 20:33 ` Randy Dunlap
@ 2010-12-01  1:33 ` Li Zefan
  1 sibling, 0 replies; 3+ messages in thread
From: Li Zefan @ 2010-12-01  1:33 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Miao Xie, Chris Mason, linux-btrfs, Linux Kernel Development,
	Andrew Morton

Geert Uytterhoeven wrote:
> If CONFIG_LBDAF=3Dy, `sector_t' becomes `u64' instead of `unsigned lo=
ng':
>=20
> fs/btrfs/inode.c: In function =A1btrfs_end_dio_bio=A2:
> fs/btrfs/inode.c:5717: warning: format =A1%lu=A2 expects type =A1long=
 unsigned int=A2, but argument 4 has type =A1sector_t=A2
>=20
> Hence always cast it to `unsigned long long' for printing.
>=20
> Introduced by commit e65e1535542931e51189832264cd282e5899e4b9 ("btrfs=
: fix
> panic caused by direct IO")
>=20
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

While we are at this..

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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

=46ix this newly introduced warning:

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

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 *inod=
e, int rw, struct bio *bio,
 				   __btree_submit_bio_done);
 }
=20
+#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
=20
 static int btree_writepage(struct page *page, struct writeback_control=
 *wbc)
 {
--=20
1.6.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-01  1:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30 20:30 [PATCH] btrfs: Correct printing of sector_t Geert Uytterhoeven
2010-11-30 20:33 ` Randy Dunlap
2010-12-01  1:33 ` Li Zefan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).