[PATCH] filefrag: remove useless assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
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@xxxxxxxxxx>
---
 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;
-
 	memset(fiemap, 0, sizeof(struct fiemap));

 	if (!verbose)
 		count = 0;

 	if (sync_file)
 		flags |= FIEMAP_FLAG_SYNC;

 	if (xattr_map)
 		flags |= FIEMAP_FLAG_XATTR;

 	do {
 		fiemap->fm_length = ~0ULL;
--
1.7.3.5.44.g960a
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux