linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: fix compile warning in fs/btrfs/inode.c
@ 2010-12-08 10:01 liubo
  2010-12-08 23:59 ` Tsutomu Itoh
  2010-12-09  1:08 ` liubo
  0 siblings, 2 replies; 3+ messages in thread
From: liubo @ 2010-12-08 10:01 UTC (permalink / raw)
  To: Linux Btrfs

While compiling btrfs, I got belows:

  CC [M]  fs/btrfs/inode.o
fs/btrfs/inode.c: In function =E2=80=98btrfs_end_dio_bio=E2=80=99:
fs/btrfs/inode.c:5720: warning: format =E2=80=98%lu=E2=80=99 expects ty=
pe =E2=80=98long unsigned int=E2=80=99, but argument 4 has type =E2=80=98=
sector_t=E2=80=99
  LD [M]  fs/btrfs/btrfs.o
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M]  fs/btrfs/btrfs.ko

This fixes the compile warning.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
 fs/btrfs/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0f34cae..eff5aef 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5713,8 +5713,8 @@ static void btrfs_end_dio_bio(struct bio *bio, in=
t 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);
+		      dip->inode->i_ino, bio->bi_rw,
+		      (unsigned long)bio->bi_sector, bio->bi_size, err);
 		dip->errors =3D 1;
=20
 		/*
--=20
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Btrfs: fix compile warning in fs/btrfs/inode.c
  2010-12-08 10:01 [PATCH] Btrfs: fix compile warning in fs/btrfs/inode.c liubo
@ 2010-12-08 23:59 ` Tsutomu Itoh
  2010-12-09  1:08 ` liubo
  1 sibling, 0 replies; 3+ messages in thread
From: Tsutomu Itoh @ 2010-12-08 23:59 UTC (permalink / raw)
  To: liubo; +Cc: Linux Btrfs

(2010/12/08 19:01), liubo wrote:
> While compiling btrfs, I got belows:
>=20
>   CC [M]  fs/btrfs/inode.o
> fs/btrfs/inode.c: In function =E2=80=98btrfs_end_dio_bio=E2=80=99:
> fs/btrfs/inode.c:5720: 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
>   LD [M]  fs/btrfs/btrfs.o
>   Building modules, stage 2.
>   MODPOST 1 modules
>   LD [M]  fs/btrfs/btrfs.ko
>=20
> This fixes the compile warning.
>=20
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
>  fs/btrfs/inode.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 0f34cae..eff5aef 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -5713,8 +5713,8 @@ 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);
> +		      dip->inode->i_ino, bio->bi_rw,
> +		      (unsigned long)bio->bi_sector, bio->bi_size, err);

sector_t is defined by include/linux/types.h as follows.

  #ifdef CONFIG_LBDAF
  typedef u64 sector_t;
  typedef u64 blkcnt_t;
  #else
  typedef unsigned long sector_t;
  typedef unsigned long blkcnt_t;
  #endif

Therefore, I think that you should change the code as follows.=20
=20
		printk(KERN_ERR "btrfs direct IO failed ino %lu rw %lu "
		      "disk_bytenr %llu len %u err no %d\n",
		      dip->inode->i_ino, bio->bi_rw,
		      (u64)bio->bi_sector, bio->bi_size, err);

>  		dip->errors =3D 1;
> =20
>  		/*

Regards,
Itoh

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Btrfs: fix compile warning in fs/btrfs/inode.c
  2010-12-08 10:01 [PATCH] Btrfs: fix compile warning in fs/btrfs/inode.c liubo
  2010-12-08 23:59 ` Tsutomu Itoh
@ 2010-12-09  1:08 ` liubo
  1 sibling, 0 replies; 3+ messages in thread
From: liubo @ 2010-12-09  1:08 UTC (permalink / raw)
  To: Linux Btrfs

On 12/08/2010 06:01 PM, liubo wrote:
> While compiling btrfs, I got belows:
>=20
>   CC [M]  fs/btrfs/inode.o
> fs/btrfs/inode.c: In function =E2=80=98btrfs_end_dio_bio=E2=80=99:
> fs/btrfs/inode.c:5720: 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
>   LD [M]  fs/btrfs/btrfs.o
>   Building modules, stage 2.
>   MODPOST 1 modules
>   LD [M]  fs/btrfs/btrfs.ko
>=20
> This fixes the compile warning.
>=20

Sorry, plz ignore this.

Have seen someone post patch to fix this.

thanks,
Liu Bo

> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
>  fs/btrfs/inode.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 0f34cae..eff5aef 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -5713,8 +5713,8 @@ 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);
> +		      dip->inode->i_ino, bio->bi_rw,
> +		      (unsigned long)bio->bi_sector, bio->bi_size, err);
>  		dip->errors =3D 1;
> =20
>  		/*

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-08 10:01 [PATCH] Btrfs: fix compile warning in fs/btrfs/inode.c liubo
2010-12-08 23:59 ` Tsutomu Itoh
2010-12-09  1:08 ` liubo

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).