From: Jim Meyering <jim@meyering.net>
To: ext <linux-ext4@vger.kernel.org>
Subject: [PATCH] filefrag: remove useless assignment
Date: Wed, 02 Feb 2011 21:55:38 +0100 [thread overview]
Message-ID: <87ei7qp35h.fsf@meyering.net> (raw)
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;
next reply other threads:[~2011-02-02 20:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-02 20:55 Jim Meyering [this message]
2011-02-07 0:01 ` [PATCH] filefrag: remove useless assignment Ted Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ei7qp35h.fsf@meyering.net \
--to=jim@meyering.net \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.