[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1386323897-2354-7-git-send-email-wenqing.lz@taobao.com>
Date: Fri, 6 Dec 2013 17:57:53 +0800
From: Zheng Liu <gnehzuil.liu@...il.com>
To: linux-ext4@...r.kernel.org
Cc: Theodore Ts'o <tytso@....edu>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Zheng Liu <wenqing.lz@...bao.com>
Subject: [PATCH v3 06/30] libext2fs: remove redundant code
From: "Darrick J. Wong" <darrick.wong@...cle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
---
lib/ext2fs/ext_attr.c | 39 +++++++++++++++++----------------------
1 file changed, 17 insertions(+), 22 deletions(-)
diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c
index 81f60ca..1b65c4b 100644
--- a/lib/ext2fs/ext_attr.c
+++ b/lib/ext2fs/ext_attr.c
@@ -466,7 +466,7 @@ errcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle)
__u32 ea_inode_magic;
blk64_t blk;
unsigned int storage_size;
- unsigned int i, written;
+ unsigned int i;
errcode_t err;
if (!EXT2_HAS_COMPAT_FEATURE(handle->fs->super,
@@ -531,26 +531,24 @@ write_ea_block:
goto out2;
}
- if (block_buf) {
- /* Write a header on the EA block */
- header = block_buf;
- header->h_magic = EXT2_EXT_ATTR_MAGIC;
- header->h_refcount = 1;
- header->h_blocks = 1;
+ /* Write a header on the EA block */
+ header = block_buf;
+ header->h_magic = EXT2_EXT_ATTR_MAGIC;
+ header->h_refcount = 1;
+ header->h_blocks = 1;
- /* Get a new block for writing */
- err = prep_ea_block_for_write(handle->fs, handle->ino, inode);
- if (err)
- goto out2;
+ /* Get a new block for writing */
+ err = prep_ea_block_for_write(handle->fs, handle->ino, inode);
+ if (err)
+ goto out2;
- /* Finally, write the new EA block */
- blk = ext2fs_file_acl_block(handle->fs,
- (struct ext2_inode *)inode);
- err = ext2fs_write_ext_attr3(handle->fs, blk, block_buf,
- handle->ino);
- if (err)
- goto out2;
- }
+ /* Finally, write the new EA block */
+ blk = ext2fs_file_acl_block(handle->fs,
+ (struct ext2_inode *)inode);
+ err = ext2fs_write_ext_attr3(handle->fs, blk, block_buf,
+ handle->ino);
+ if (err)
+ goto out2;
skip_ea_block:
blk = ext2fs_file_acl_block(handle->fs, (struct ext2_inode *)inode);
@@ -663,7 +661,6 @@ static errcode_t read_xattrs_from_buffer(struct ext2_xattr_handle *handle,
errcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle)
{
struct ext2_xattr *attrs = NULL, *x;
- unsigned int attrs_len;
struct ext2_inode_large *inode;
struct ext2_ext_attr_header *header;
__u32 ea_inode_magic;
@@ -765,8 +762,6 @@ out:
return err;
}
-#define XATTR_ABORT 1
-#define XATTR_CHANGED 2
errcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,
int (*func)(char *name, char *value,
size_t value_len, void *data),
--
1.7.9.7
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists