forked from tytso/e2fsprogs-inline-patch-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path30-libext2fs-xattr-cleanups.patch
78 lines (70 loc) · 2.25 KB
/
30-libext2fs-xattr-cleanups.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From: Darrick J. Wong <[email protected]>
libext2fs: remove redundant code
Signed-off-by: Darrick J. Wong <[email protected]>
diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c
index 3e09d58..934ad6f 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;
i = EXT2_INODE_SIZE(handle->fs->super);
@@ -527,26 +527,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);
@@ -659,7 +657,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;
@@ -757,8 +754,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),