diff options
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 3a8cd8dff1ad..c757adc97250 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -427,23 +427,23 @@ cleanup: | |||
427 | static int | 427 | static int |
428 | ext4_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size) | 428 | ext4_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size) |
429 | { | 429 | { |
430 | int i_error, b_error; | 430 | int ret, ret2; |
431 | 431 | ||
432 | down_read(&EXT4_I(dentry->d_inode)->xattr_sem); | 432 | down_read(&EXT4_I(dentry->d_inode)->xattr_sem); |
433 | i_error = ext4_xattr_ibody_list(dentry, buffer, buffer_size); | 433 | ret = ret2 = ext4_xattr_ibody_list(dentry, buffer, buffer_size); |
434 | if (i_error < 0) { | 434 | if (ret < 0) |
435 | b_error = 0; | 435 | goto errout; |
436 | } else { | 436 | if (buffer) { |
437 | if (buffer) { | 437 | buffer += ret; |
438 | buffer += i_error; | 438 | buffer_size -= ret; |
439 | buffer_size -= i_error; | ||
440 | } | ||
441 | b_error = ext4_xattr_block_list(dentry, buffer, buffer_size); | ||
442 | if (b_error < 0) | ||
443 | i_error = 0; | ||
444 | } | 439 | } |
440 | ret = ext4_xattr_block_list(dentry, buffer, buffer_size); | ||
441 | if (ret < 0) | ||
442 | goto errout; | ||
443 | ret += ret2; | ||
444 | errout: | ||
445 | up_read(&EXT4_I(dentry->d_inode)->xattr_sem); | 445 | up_read(&EXT4_I(dentry->d_inode)->xattr_sem); |
446 | return i_error + b_error; | 446 | return ret; |
447 | } | 447 | } |
448 | 448 | ||
449 | /* | 449 | /* |
@@ -735,7 +735,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, | |||
735 | int offset = (char *)s->here - bs->bh->b_data; | 735 | int offset = (char *)s->here - bs->bh->b_data; |
736 | 736 | ||
737 | unlock_buffer(bs->bh); | 737 | unlock_buffer(bs->bh); |
738 | jbd2_journal_release_buffer(handle, bs->bh); | 738 | ext4_handle_release_buffer(handle, bs->bh); |
739 | if (ce) { | 739 | if (ce) { |
740 | mb_cache_entry_release(ce); | 740 | mb_cache_entry_release(ce); |
741 | ce = NULL; | 741 | ce = NULL; |
@@ -820,8 +820,8 @@ inserted: | |||
820 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) | 820 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |
821 | goal = goal & EXT4_MAX_BLOCK_FILE_PHYS; | 821 | goal = goal & EXT4_MAX_BLOCK_FILE_PHYS; |
822 | 822 | ||
823 | block = ext4_new_meta_blocks(handle, inode, | 823 | block = ext4_new_meta_blocks(handle, inode, goal, 0, |
824 | goal, NULL, &error); | 824 | NULL, &error); |
825 | if (error) | 825 | if (error) |
826 | goto cleanup; | 826 | goto cleanup; |
827 | 827 | ||
@@ -833,7 +833,7 @@ inserted: | |||
833 | new_bh = sb_getblk(sb, block); | 833 | new_bh = sb_getblk(sb, block); |
834 | if (!new_bh) { | 834 | if (!new_bh) { |
835 | getblk_failed: | 835 | getblk_failed: |
836 | ext4_free_blocks(handle, inode, 0, block, 1, | 836 | ext4_free_blocks(handle, inode, NULL, block, 1, |
837 | EXT4_FREE_BLOCKS_METADATA); | 837 | EXT4_FREE_BLOCKS_METADATA); |
838 | error = -EIO; | 838 | error = -EIO; |
839 | goto cleanup; | 839 | goto cleanup; |
@@ -947,7 +947,7 @@ ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, | |||
947 | /* | 947 | /* |
948 | * ext4_xattr_set_handle() | 948 | * ext4_xattr_set_handle() |
949 | * | 949 | * |
950 | * Create, replace or remove an extended attribute for this inode. Buffer | 950 | * Create, replace or remove an extended attribute for this inode. Value |
951 | * is NULL to remove an existing extended attribute, and non-NULL to | 951 | * is NULL to remove an existing extended attribute, and non-NULL to |
952 | * either replace an existing extended attribute, or create a new extended | 952 | * either replace an existing extended attribute, or create a new extended |
953 | * attribute. The flags XATTR_REPLACE and XATTR_CREATE | 953 | * attribute. The flags XATTR_REPLACE and XATTR_CREATE |
@@ -1588,7 +1588,7 @@ static void ext4_xattr_rehash(struct ext4_xattr_header *header, | |||
1588 | #undef BLOCK_HASH_SHIFT | 1588 | #undef BLOCK_HASH_SHIFT |
1589 | 1589 | ||
1590 | int __init | 1590 | int __init |
1591 | init_ext4_xattr(void) | 1591 | ext4_init_xattr(void) |
1592 | { | 1592 | { |
1593 | ext4_xattr_cache = mb_cache_create("ext4_xattr", 6); | 1593 | ext4_xattr_cache = mb_cache_create("ext4_xattr", 6); |
1594 | if (!ext4_xattr_cache) | 1594 | if (!ext4_xattr_cache) |
@@ -1597,7 +1597,7 @@ init_ext4_xattr(void) | |||
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | void | 1599 | void |
1600 | exit_ext4_xattr(void) | 1600 | ext4_exit_xattr(void) |
1601 | { | 1601 | { |
1602 | if (ext4_xattr_cache) | 1602 | if (ext4_xattr_cache) |
1603 | mb_cache_destroy(ext4_xattr_cache); | 1603 | mb_cache_destroy(ext4_xattr_cache); |