Skip to content

Commit

Permalink
ocfs2: Remove unused ocfs2_restore_xattr_block().
Browse files Browse the repository at this point in the history
Since now ocfs2 supports empty xattr buckets, we will never remove
the xattr index tree even if all the xattrs are removed, so this
function will never be called. So remove it.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Nov 10, 2008
1 parent 54f443f commit 63fd775
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions 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 63fd775

Please sign in to comment.