All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fibmap.f2fs: fix the wrong stat info
@ 2015-01-22  3:19 Chao Yu
  2015-01-23 21:19 ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2015-01-22  3:19 UTC (permalink / raw)
  To: Jaegeuk Kim, Changman Lee; +Cc: linux-f2fs-devel

fibmap shows ino, size, blocks with incorrectly decimal number, fix it.

Before:
--------------------------------------------
dev       [8:16]
ino       [0x   238ea : 0]
mode      [0x    81a4 : 33188]
nlink     [0x       1 : 1]
uid       [0x       0 : 0]
gid       [0x       0 : 0]
size      [0x   79e00 : 0]
blksize   [0x    1000 : 4096]
blocks    [0x     268 : 0]
--------------------------------------------

Patched:
--------------------------------------------
dev       [8:16]
ino       [0x   238ea : 145642]
mode      [0x    81a4 : 33188]
nlink     [0x       1 : 1]
uid       [0x       0 : 0]
gid       [0x       0 : 0]
size      [0x   79e00 : 499200]
blksize   [0x    1000 : 4096]
blocks    [0x     268 : 616]
--------------------------------------------

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 tools/fibmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/fibmap.c b/tools/fibmap.c
index a6a112b..2df8094 100644
--- a/tools/fibmap.c
+++ b/tools/fibmap.c
@@ -33,14 +33,14 @@ void print_stat(struct stat64 *st)
 {
 	printf("--------------------------------------------\n");
 	printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
-	printf("ino       [0x%8lx : %ld]\n", st->st_ino, st->st_ino);
+	printf("ino       [0x%8llx : %lld]\n", st->st_ino, st->st_ino);
 	printf("mode      [0x%8x : %d]\n", st->st_mode, st->st_mode);
 	printf("nlink     [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink);
 	printf("uid       [0x%8x : %d]\n", st->st_uid, st->st_uid);
 	printf("gid       [0x%8x : %d]\n", st->st_gid, st->st_gid);
-	printf("size      [0x%8lx : %ld]\n", st->st_size, st->st_size);
+	printf("size      [0x%8llx : %lld]\n", st->st_size, st->st_size);
 	printf("blksize   [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize);
-	printf("blocks    [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks);
+	printf("blocks    [0x%8llx : %lld]\n", st->st_blocks, st->st_blocks);
 	printf("--------------------------------------------\n\n");
 }
 
-- 
2.2.1



------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet

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

* Re: [PATCH] fibmap.f2fs: fix the wrong stat info
  2015-01-22  3:19 [PATCH] fibmap.f2fs: fix the wrong stat info Chao Yu
@ 2015-01-23 21:19 ` Jaegeuk Kim
  2015-01-26 10:43   ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2015-01-23 21:19 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-f2fs-devel

Hi Chao,

On Thu, Jan 22, 2015 at 11:19:05AM +0800, Chao Yu wrote:
> fibmap shows ino, size, blocks with incorrectly decimal number, fix it.
> 
> Before:
> --------------------------------------------
> dev       [8:16]
> ino       [0x   238ea : 0]
> mode      [0x    81a4 : 33188]
> nlink     [0x       1 : 1]
> uid       [0x       0 : 0]
> gid       [0x       0 : 0]
> size      [0x   79e00 : 0]
> blksize   [0x    1000 : 4096]
> blocks    [0x     268 : 0]
> --------------------------------------------
> 
> Patched:
> --------------------------------------------
> dev       [8:16]
> ino       [0x   238ea : 145642]
> mode      [0x    81a4 : 33188]
> nlink     [0x       1 : 1]
> uid       [0x       0 : 0]
> gid       [0x       0 : 0]
> size      [0x   79e00 : 499200]
> blksize   [0x    1000 : 4096]
> blocks    [0x     268 : 616]
> --------------------------------------------
> 
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
>  tools/fibmap.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/fibmap.c b/tools/fibmap.c
> index a6a112b..2df8094 100644
> --- a/tools/fibmap.c
> +++ b/tools/fibmap.c
> @@ -33,14 +33,14 @@ void print_stat(struct stat64 *st)
>  {
>  	printf("--------------------------------------------\n");
>  	printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
> -	printf("ino       [0x%8lx : %ld]\n", st->st_ino, st->st_ino);
> +	printf("ino       [0x%8llx : %lld]\n", st->st_ino, st->st_ino);
>  	printf("mode      [0x%8x : %d]\n", st->st_mode, st->st_mode);
>  	printf("nlink     [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink);
>  	printf("uid       [0x%8x : %d]\n", st->st_uid, st->st_uid);
>  	printf("gid       [0x%8x : %d]\n", st->st_gid, st->st_gid);
> -	printf("size      [0x%8lx : %ld]\n", st->st_size, st->st_size);
> +	printf("size      [0x%8llx : %lld]\n", st->st_size, st->st_size);
>  	printf("blksize   [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize);
> -	printf("blocks    [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks);
> +	printf("blocks    [0x%8llx : %lld]\n", st->st_blocks, st->st_blocks);
>  	printf("--------------------------------------------\n\n");
>  }

It needs to use like this.
Could you check this out?

Thanks,

>From 5a510076b737b734bdeab95dd4b597cdb681fb29 Mon Sep 17 00:00:00 2001
From: Chao Yu <chao2.yu@samsung.com>
Date: Thu, 22 Jan 2015 11:19:05 +0800
Subject: [PATCH] fibmap.f2fs: fix the wrong stat info

fibmap shows ino, size, blocks with incorrectly decimal number, fix it.

Before:
--------------------------------------------
dev       [8:16]
ino       [0x   238ea : 0]
mode      [0x    81a4 : 33188]
nlink     [0x       1 : 1]
uid       [0x       0 : 0]
gid       [0x       0 : 0]
size      [0x   79e00 : 0]
blksize   [0x    1000 : 4096]
blocks    [0x     268 : 0]
--------------------------------------------

Patched:
--------------------------------------------
dev       [8:16]
ino       [0x   238ea : 145642]
mode      [0x    81a4 : 33188]
nlink     [0x       1 : 1]
uid       [0x       0 : 0]
gid       [0x       0 : 0]
size      [0x   79e00 : 499200]
blksize   [0x    1000 : 4096]
blocks    [0x     268 : 616]
--------------------------------------------

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 tools/fibmap.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/fibmap.c b/tools/fibmap.c
index a6a112b..224b233 100644
--- a/tools/fibmap.c
+++ b/tools/fibmap.c
@@ -12,6 +12,7 @@
 #include <linux/hdreg.h>
 #include <linux/types.h>
 #include <linux/fs.h>
+#include <inttypes.h>
 
 struct file_ext {
 	__u32 f_pos;
@@ -33,14 +34,17 @@ void print_stat(struct stat64 *st)
 {
 	printf("--------------------------------------------\n");
 	printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
-	printf("ino       [0x%8lx : %ld]\n", st->st_ino, st->st_ino);
+	printf("ino       [0x%8"PRIx64" : %"PRIu64"]\n",
+						st->st_ino, st->st_ino);
 	printf("mode      [0x%8x : %d]\n", st->st_mode, st->st_mode);
 	printf("nlink     [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink);
 	printf("uid       [0x%8x : %d]\n", st->st_uid, st->st_uid);
 	printf("gid       [0x%8x : %d]\n", st->st_gid, st->st_gid);
-	printf("size      [0x%8lx : %ld]\n", st->st_size, st->st_size);
+	printf("size      [0x%8"PRIx64" : %"PRIu64"]\n",
+						st->st_size, st->st_size);
 	printf("blksize   [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize);
-	printf("blocks    [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks);
+	printf("blocks    [0x%8"PRIx64" : %"PRIu64"]\n",
+					st->st_blocks, st->st_blocks);
 	printf("--------------------------------------------\n\n");
 }
 
-- 
2.1.1


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet

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

* Re: [PATCH] fibmap.f2fs: fix the wrong stat info
  2015-01-23 21:19 ` Jaegeuk Kim
@ 2015-01-26 10:43   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2015-01-26 10:43 UTC (permalink / raw)
  To: 'Jaegeuk Kim'; +Cc: linux-f2fs-devel

Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Saturday, January 24, 2015 5:20 AM
> To: Chao Yu
> Cc: Changman Lee; linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev][PATCH] fibmap.f2fs: fix the wrong stat info
> 
> Hi Chao,
> 
> On Thu, Jan 22, 2015 at 11:19:05AM +0800, Chao Yu wrote:
> > fibmap shows ino, size, blocks with incorrectly decimal number, fix it.
> >
> > Before:
> > --------------------------------------------
> > dev       [8:16]
> > ino       [0x   238ea : 0]
> > mode      [0x    81a4 : 33188]
> > nlink     [0x       1 : 1]
> > uid       [0x       0 : 0]
> > gid       [0x       0 : 0]
> > size      [0x   79e00 : 0]
> > blksize   [0x    1000 : 4096]
> > blocks    [0x     268 : 0]
> > --------------------------------------------
> >
> > Patched:
> > --------------------------------------------
> > dev       [8:16]
> > ino       [0x   238ea : 145642]
> > mode      [0x    81a4 : 33188]
> > nlink     [0x       1 : 1]
> > uid       [0x       0 : 0]
> > gid       [0x       0 : 0]
> > size      [0x   79e00 : 499200]
> > blksize   [0x    1000 : 4096]
> > blocks    [0x     268 : 616]
> > --------------------------------------------
> >
> > Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> > ---
> >  tools/fibmap.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/fibmap.c b/tools/fibmap.c
> > index a6a112b..2df8094 100644
> > --- a/tools/fibmap.c
> > +++ b/tools/fibmap.c
> > @@ -33,14 +33,14 @@ void print_stat(struct stat64 *st)
> >  {
> >  	printf("--------------------------------------------\n");
> >  	printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
> > -	printf("ino       [0x%8lx : %ld]\n", st->st_ino, st->st_ino);
> > +	printf("ino       [0x%8llx : %lld]\n", st->st_ino, st->st_ino);
> >  	printf("mode      [0x%8x : %d]\n", st->st_mode, st->st_mode);
> >  	printf("nlink     [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink);
> >  	printf("uid       [0x%8x : %d]\n", st->st_uid, st->st_uid);
> >  	printf("gid       [0x%8x : %d]\n", st->st_gid, st->st_gid);
> > -	printf("size      [0x%8lx : %ld]\n", st->st_size, st->st_size);
> > +	printf("size      [0x%8llx : %lld]\n", st->st_size, st->st_size);
> >  	printf("blksize   [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize);
> > -	printf("blocks    [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks);
> > +	printf("blocks    [0x%8llx : %lld]\n", st->st_blocks, st->st_blocks);
> >  	printf("--------------------------------------------\n\n");
> >  }
> 
> It needs to use like this.
> Could you check this out?

Very good, this can fix the portability issue, thanks. :)

> 
> Thanks,
> 
> From 5a510076b737b734bdeab95dd4b597cdb681fb29 Mon Sep 17 00:00:00 2001
> From: Chao Yu <chao2.yu@samsung.com>
> Date: Thu, 22 Jan 2015 11:19:05 +0800
> Subject: [PATCH] fibmap.f2fs: fix the wrong stat info
> 
> fibmap shows ino, size, blocks with incorrectly decimal number, fix it.
> 
> Before:
> --------------------------------------------
> dev       [8:16]
> ino       [0x   238ea : 0]
> mode      [0x    81a4 : 33188]
> nlink     [0x       1 : 1]
> uid       [0x       0 : 0]
> gid       [0x       0 : 0]
> size      [0x   79e00 : 0]
> blksize   [0x    1000 : 4096]
> blocks    [0x     268 : 0]
> --------------------------------------------
> 
> Patched:
> --------------------------------------------
> dev       [8:16]
> ino       [0x   238ea : 145642]
> mode      [0x    81a4 : 33188]
> nlink     [0x       1 : 1]
> uid       [0x       0 : 0]
> gid       [0x       0 : 0]
> size      [0x   79e00 : 499200]
> blksize   [0x    1000 : 4096]
> blocks    [0x     268 : 616]
> --------------------------------------------
> 
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  tools/fibmap.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/fibmap.c b/tools/fibmap.c
> index a6a112b..224b233 100644
> --- a/tools/fibmap.c
> +++ b/tools/fibmap.c
> @@ -12,6 +12,7 @@
>  #include <linux/hdreg.h>
>  #include <linux/types.h>
>  #include <linux/fs.h>
> +#include <inttypes.h>
> 
>  struct file_ext {
>  	__u32 f_pos;
> @@ -33,14 +34,17 @@ void print_stat(struct stat64 *st)
>  {
>  	printf("--------------------------------------------\n");
>  	printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
> -	printf("ino       [0x%8lx : %ld]\n", st->st_ino, st->st_ino);
> +	printf("ino       [0x%8"PRIx64" : %"PRIu64"]\n",
> +						st->st_ino, st->st_ino);
>  	printf("mode      [0x%8x : %d]\n", st->st_mode, st->st_mode);
>  	printf("nlink     [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink);
>  	printf("uid       [0x%8x : %d]\n", st->st_uid, st->st_uid);
>  	printf("gid       [0x%8x : %d]\n", st->st_gid, st->st_gid);
> -	printf("size      [0x%8lx : %ld]\n", st->st_size, st->st_size);
> +	printf("size      [0x%8"PRIx64" : %"PRIu64"]\n",
> +						st->st_size, st->st_size);
>  	printf("blksize   [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize);
> -	printf("blocks    [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks);
> +	printf("blocks    [0x%8"PRIx64" : %"PRIu64"]\n",
> +					st->st_blocks, st->st_blocks);
>  	printf("--------------------------------------------\n\n");
>  }
> 
> --
> 2.1.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

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

end of thread, other threads:[~2015-01-26 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22  3:19 [PATCH] fibmap.f2fs: fix the wrong stat info Chao Yu
2015-01-23 21:19 ` Jaegeuk Kim
2015-01-26 10:43   ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.