aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/xattr.c')
-rw-r--r--fs/ext3/xattr.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 42856541e9a5..d4a4f0e9ff69 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -99,6 +99,8 @@ static struct buffer_head *ext3_xattr_cache_find(struct inode *,
99 struct mb_cache_entry **); 99 struct mb_cache_entry **);
100static void ext3_xattr_rehash(struct ext3_xattr_header *, 100static void ext3_xattr_rehash(struct ext3_xattr_header *,
101 struct ext3_xattr_entry *); 101 struct ext3_xattr_entry *);
102static int ext3_xattr_list(struct inode *inode, char *buffer,
103 size_t buffer_size);
102 104
103static struct mb_cache *ext3_xattr_cache; 105static struct mb_cache *ext3_xattr_cache;
104 106
@@ -232,7 +234,7 @@ ext3_xattr_block_get(struct inode *inode, int name_index, const char *name,
232 ea_bdebug(bh, "b_count=%d, refcount=%d", 234 ea_bdebug(bh, "b_count=%d, refcount=%d",
233 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); 235 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
234 if (ext3_xattr_check_block(bh)) { 236 if (ext3_xattr_check_block(bh)) {
235bad_block: ext3_error(inode->i_sb, __FUNCTION__, 237bad_block: ext3_error(inode->i_sb, __func__,
236 "inode %lu: bad block "E3FSBLK, inode->i_ino, 238 "inode %lu: bad block "E3FSBLK, inode->i_ino,
237 EXT3_I(inode)->i_file_acl); 239 EXT3_I(inode)->i_file_acl);
238 error = -EIO; 240 error = -EIO;
@@ -374,7 +376,7 @@ ext3_xattr_block_list(struct inode *inode, char *buffer, size_t buffer_size)
374 ea_bdebug(bh, "b_count=%d, refcount=%d", 376 ea_bdebug(bh, "b_count=%d, refcount=%d",
375 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); 377 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
376 if (ext3_xattr_check_block(bh)) { 378 if (ext3_xattr_check_block(bh)) {
377 ext3_error(inode->i_sb, __FUNCTION__, 379 ext3_error(inode->i_sb, __func__,
378 "inode %lu: bad block "E3FSBLK, inode->i_ino, 380 "inode %lu: bad block "E3FSBLK, inode->i_ino,
379 EXT3_I(inode)->i_file_acl); 381 EXT3_I(inode)->i_file_acl);
380 error = -EIO; 382 error = -EIO;
@@ -427,7 +429,7 @@ cleanup:
427 * Returns a negative error number on failure, or the number of bytes 429 * Returns a negative error number on failure, or the number of bytes
428 * used / required on success. 430 * used / required on success.
429 */ 431 */
430int 432static int
431ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size) 433ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size)
432{ 434{
433 int i_error, b_error; 435 int i_error, b_error;
@@ -649,7 +651,7 @@ ext3_xattr_block_find(struct inode *inode, struct ext3_xattr_info *i,
649 atomic_read(&(bs->bh->b_count)), 651 atomic_read(&(bs->bh->b_count)),
650 le32_to_cpu(BHDR(bs->bh)->h_refcount)); 652 le32_to_cpu(BHDR(bs->bh)->h_refcount));
651 if (ext3_xattr_check_block(bs->bh)) { 653 if (ext3_xattr_check_block(bs->bh)) {
652 ext3_error(sb, __FUNCTION__, 654 ext3_error(sb, __func__,
653 "inode %lu: bad block "E3FSBLK, inode->i_ino, 655 "inode %lu: bad block "E3FSBLK, inode->i_ino,
654 EXT3_I(inode)->i_file_acl); 656 EXT3_I(inode)->i_file_acl);
655 error = -EIO; 657 error = -EIO;
@@ -797,10 +799,8 @@ inserted:
797 get_bh(new_bh); 799 get_bh(new_bh);
798 } else { 800 } else {
799 /* We need to allocate a new block */ 801 /* We need to allocate a new block */
800 ext3_fsblk_t goal = le32_to_cpu( 802 ext3_fsblk_t goal = ext3_group_first_block_no(sb,
801 EXT3_SB(sb)->s_es->s_first_data_block) + 803 EXT3_I(inode)->i_block_group);
802 (ext3_fsblk_t)EXT3_I(inode)->i_block_group *
803 EXT3_BLOCKS_PER_GROUP(sb);
804 ext3_fsblk_t block = ext3_new_block(handle, inode, 804 ext3_fsblk_t block = ext3_new_block(handle, inode,
805 goal, &error); 805 goal, &error);
806 if (error) 806 if (error)
@@ -852,7 +852,7 @@ cleanup_dquot:
852 goto cleanup; 852 goto cleanup;
853 853
854bad_block: 854bad_block:
855 ext3_error(inode->i_sb, __FUNCTION__, 855 ext3_error(inode->i_sb, __func__,
856 "inode %lu: bad block "E3FSBLK, inode->i_ino, 856 "inode %lu: bad block "E3FSBLK, inode->i_ino,
857 EXT3_I(inode)->i_file_acl); 857 EXT3_I(inode)->i_file_acl);
858 goto cleanup; 858 goto cleanup;
@@ -1081,14 +1081,14 @@ ext3_xattr_delete_inode(handle_t *handle, struct inode *inode)
1081 goto cleanup; 1081 goto cleanup;
1082 bh = sb_bread(inode->i_sb, EXT3_I(inode)->i_file_acl); 1082 bh = sb_bread(inode->i_sb, EXT3_I(inode)->i_file_acl);
1083 if (!bh) { 1083 if (!bh) {
1084 ext3_error(inode->i_sb, __FUNCTION__, 1084 ext3_error(inode->i_sb, __func__,
1085 "inode %lu: block "E3FSBLK" read error", inode->i_ino, 1085 "inode %lu: block "E3FSBLK" read error", inode->i_ino,
1086 EXT3_I(inode)->i_file_acl); 1086 EXT3_I(inode)->i_file_acl);
1087 goto cleanup; 1087 goto cleanup;
1088 } 1088 }
1089 if (BHDR(bh)->h_magic != cpu_to_le32(EXT3_XATTR_MAGIC) || 1089 if (BHDR(bh)->h_magic != cpu_to_le32(EXT3_XATTR_MAGIC) ||
1090 BHDR(bh)->h_blocks != cpu_to_le32(1)) { 1090 BHDR(bh)->h_blocks != cpu_to_le32(1)) {
1091 ext3_error(inode->i_sb, __FUNCTION__, 1091 ext3_error(inode->i_sb, __func__,
1092 "inode %lu: bad block "E3FSBLK, inode->i_ino, 1092 "inode %lu: bad block "E3FSBLK, inode->i_ino,
1093 EXT3_I(inode)->i_file_acl); 1093 EXT3_I(inode)->i_file_acl);
1094 goto cleanup; 1094 goto cleanup;
@@ -1215,7 +1215,7 @@ again:
1215 } 1215 }
1216 bh = sb_bread(inode->i_sb, ce->e_block); 1216 bh = sb_bread(inode->i_sb, ce->e_block);
1217 if (!bh) { 1217 if (!bh) {
1218 ext3_error(inode->i_sb, __FUNCTION__, 1218 ext3_error(inode->i_sb, __func__,
1219 "inode %lu: block %lu read error", 1219 "inode %lu: block %lu read error",
1220 inode->i_ino, (unsigned long) ce->e_block); 1220 inode->i_ino, (unsigned long) ce->e_block);
1221 } else if (le32_to_cpu(BHDR(bh)->h_refcount) >= 1221 } else if (le32_to_cpu(BHDR(bh)->h_refcount) >=