Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118740
b: refs/heads/master
c: 63fd775
h: refs/heads/master
v: v3
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Nov 10, 2008
1 parent bb91a3e commit e5fc6de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54f443f4e7265a1333886dbace31cb6eb1991c72
refs/heads/master: 63fd77573723841d5d44a79471258f1b261f4482
48 changes: 0 additions & 48 deletions trunk/fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,52 +1791,6 @@ static int ocfs2_xattr_block_find(struct inode *inode,
return ret;
}

/*
* When all the xattrs are deleted from index btree, the ocfs2_xattr_tree
* will be erased and ocfs2_xattr_block will have its ocfs2_xattr_header
* re-initialized.
*/
static int ocfs2_restore_xattr_block(struct inode *inode,
struct ocfs2_xattr_search *xs)
{
int ret;
handle_t *handle;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_xattr_block *xb =
(struct ocfs2_xattr_block *)xs->xattr_bh->b_data;
struct ocfs2_extent_list *el = &xb->xb_attrs.xb_root.xt_list;
u16 xb_flags = le16_to_cpu(xb->xb_flags);

BUG_ON(!(xb_flags & OCFS2_XATTR_INDEXED) ||
le16_to_cpu(el->l_next_free_rec) != 0);

handle = ocfs2_start_trans(osb, OCFS2_XATTR_BLOCK_UPDATE_CREDITS);
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
handle = NULL;
goto out;
}

ret = ocfs2_journal_access(handle, inode, xs->xattr_bh,
OCFS2_JOURNAL_ACCESS_WRITE);
if (ret < 0) {
mlog_errno(ret);
goto out_commit;
}

memset(&xb->xb_attrs, 0, inode->i_sb->s_blocksize -
offsetof(struct ocfs2_xattr_block, xb_attrs));

xb->xb_flags = cpu_to_le16(xb_flags & ~OCFS2_XATTR_INDEXED);

ocfs2_journal_dirty(handle, xs->xattr_bh);

out_commit:
ocfs2_commit_trans(osb, handle);
out:
return ret;
}

/*
* ocfs2_xattr_block_set()
*
Expand Down Expand Up @@ -1947,8 +1901,6 @@ static int ocfs2_xattr_block_set(struct inode *inode,
}

ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs);
if (!ret && xblk->xb_attrs.xb_root.xt_list.l_next_free_rec == 0)
ret = ocfs2_restore_xattr_block(inode, xs);

end:

Expand Down

0 comments on commit e5fc6de

Please sign in to comment.