Skip to content

Commit 310c097

Browse files
riteshharjanitytso
authored andcommitted
ext4: remove duplicate definition of ext4_xattr_ibody_inline_set()
ext4_xattr_ibody_inline_set() & ext4_xattr_ibody_set() have the exact same definition. Hence remove ext4_xattr_ibody_inline_set() and all its call references. Convert the callers of it to call ext4_xattr_ibody_set() instead. [ Modified to preserve ext4_xattr_ibody_set() and remove ext4_xattr_ibody_inline_set() instead. -- TYT ] Signed-off-by: Ritesh Harjani <[email protected]> Link: https://lore.kernel.org/r/fd566b799bbbbe9b668eb5eecde5b5e319e3694f.1622685482.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o <[email protected]>
1 parent ee00d6b commit 310c097

File tree

3 files changed

+9
-34
lines changed

3 files changed

+9
-34
lines changed

fs/ext4/inline.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static int ext4_read_inline_data(struct inode *inode, void *buffer,
204204
/*
205205
* write the buffer to the inline inode.
206206
* If 'create' is set, we don't need to do the extra copy in the xattr
207-
* value since it is already handled by ext4_xattr_ibody_inline_set.
207+
* value since it is already handled by ext4_xattr_ibody_set.
208208
* That saves us one memcpy.
209209
*/
210210
static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc,
@@ -286,7 +286,7 @@ static int ext4_create_inline_data(handle_t *handle,
286286

287287
BUG_ON(!is.s.not_found);
288288

289-
error = ext4_xattr_ibody_inline_set(handle, inode, &i, &is);
289+
error = ext4_xattr_ibody_set(handle, inode, &i, &is);
290290
if (error) {
291291
if (error == -ENOSPC)
292292
ext4_clear_inode_state(inode,
@@ -358,7 +358,7 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode,
358358
i.value = value;
359359
i.value_len = len;
360360

361-
error = ext4_xattr_ibody_inline_set(handle, inode, &i, &is);
361+
error = ext4_xattr_ibody_set(handle, inode, &i, &is);
362362
if (error)
363363
goto out;
364364

@@ -431,7 +431,7 @@ static int ext4_destroy_inline_data_nolock(handle_t *handle,
431431
if (error)
432432
goto out;
433433

434-
error = ext4_xattr_ibody_inline_set(handle, inode, &i, &is);
434+
error = ext4_xattr_ibody_set(handle, inode, &i, &is);
435435
if (error)
436436
goto out;
437437

@@ -1925,8 +1925,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline)
19251925
i.value = value;
19261926
i.value_len = i_size > EXT4_MIN_INLINE_DATA_SIZE ?
19271927
i_size - EXT4_MIN_INLINE_DATA_SIZE : 0;
1928-
err = ext4_xattr_ibody_inline_set(handle, inode,
1929-
&i, &is);
1928+
err = ext4_xattr_ibody_set(handle, inode, &i, &is);
19301929
if (err)
19311930
goto out_error;
19321931
}

fs/ext4/xattr.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,31 +2190,7 @@ int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
21902190
return 0;
21912191
}
21922192

2193-
int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
2194-
struct ext4_xattr_info *i,
2195-
struct ext4_xattr_ibody_find *is)
2196-
{
2197-
struct ext4_xattr_ibody_header *header;
2198-
struct ext4_xattr_search *s = &is->s;
2199-
int error;
2200-
2201-
if (EXT4_I(inode)->i_extra_isize == 0)
2202-
return -ENOSPC;
2203-
error = ext4_xattr_set_entry(i, s, handle, inode, false /* is_block */);
2204-
if (error)
2205-
return error;
2206-
header = IHDR(inode, ext4_raw_inode(&is->iloc));
2207-
if (!IS_LAST_ENTRY(s->first)) {
2208-
header->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC);
2209-
ext4_set_inode_state(inode, EXT4_STATE_XATTR);
2210-
} else {
2211-
header->h_magic = cpu_to_le32(0);
2212-
ext4_clear_inode_state(inode, EXT4_STATE_XATTR);
2213-
}
2214-
return 0;
2215-
}
2216-
2217-
static int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode,
2193+
int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode,
22182194
struct ext4_xattr_info *i,
22192195
struct ext4_xattr_ibody_find *is)
22202196
{

fs/ext4/xattr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ extern int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
186186
extern int ext4_xattr_ibody_get(struct inode *inode, int name_index,
187187
const char *name,
188188
void *buffer, size_t buffer_size);
189-
extern int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
190-
struct ext4_xattr_info *i,
191-
struct ext4_xattr_ibody_find *is);
189+
extern int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode,
190+
struct ext4_xattr_info *i,
191+
struct ext4_xattr_ibody_find *is);
192192

193193
extern struct mb_cache *ext4_xattr_create_cache(void);
194194
extern void ext4_xattr_destroy_cache(struct mb_cache *);

0 commit comments

Comments
 (0)