* [PATCH] filefrag: remove useless assignment
@ 2011-02-02 20:55 Jim Meyering
2011-02-07 0:01 ` Ted Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Jim Meyering @ 2011-02-02 20:55 UTC (permalink / raw)
To: ext
Barely worth posting, but...
There's no point in setting fiemap->ANYTHING
when the very next statement zeros the entire buffer.
The correct initialization is already done after the memset.
>From b2e2dd33c57dbae034b9ea7830d21681bc788fbe Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 1 Feb 2011 19:25:35 +0100
Subject: [PATCH] filefrag: remove useless assignment
The very next one memset's all bytes of fiemap to 0.
Signed-off-by: Jim Meyering <meyering@redhat.com>
---
misc/filefrag.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/misc/filefrag.c b/misc/filefrag.c
index bd4486d..d604b6c 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -168,28 +168,26 @@ static int filefrag_fiemap(int fd, int blk_shift, int *num_extents)
struct fiemap *fiemap = (struct fiemap *)buf;
struct fiemap_extent *fm_ext = &fiemap->fm_extents[0];
int count = (sizeof(buf) - sizeof(*fiemap)) /
sizeof(struct fiemap_extent);
unsigned long long last_blk = 0;
unsigned long flags = 0;
unsigned int i;
static int fiemap_incompat_printed;
int fiemap_header_printed = 0;
int tot_extents = 1, n = 0;
int last = 0;
int rc;
- fiemap->fm_length = ~0ULL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] filefrag: remove useless assignment
2011-02-02 20:55 [PATCH] filefrag: remove useless assignment Jim Meyering
@ 2011-02-07 0:01 ` Ted Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-02-07 0:01 UTC (permalink / raw)
To: Jim Meyering; +Cc: ext
On Wed, Feb 02, 2011 at 09:55:38PM +0100, Jim Meyering wrote:
> Barely worth posting, but...
> There's no point in setting fiemap->ANYTHING
> when the very next statement zeros the entire buffer.
> The correct initialization is already done after the memset.
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-07 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 20:55 [PATCH] filefrag: remove useless assignment Jim Meyering
2011-02-07 0:01 ` Ted Ts'o
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.