]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Tao Ma <tao.ma@oracle.com> |
2 | Date: Fri, 17 Oct 2008 12:44:36 +0800 | |
3 | Subject: ocfs2: Remove unused ocfs2_restore_xattr_block(). | |
4 | ||
5 | Since now ocfs2 supports empty xattr buckets, we will never remove | |
6 | the xattr index tree even if all the xattrs are removed, so this | |
7 | function will never be called. So remove it. | |
8 | ||
9 | Signed-off-by: Tao Ma <tao.ma@oracle.com> | |
10 | Signed-off-by: Joel Becker <joel.becker@oracle.com> | |
11 | Signed-off-by: Mark Fasheh <mfasheh@suse.com> | |
12 | --- | |
13 | fs/ocfs2/xattr.c | 48 ------------------------------------------------ | |
14 | 1 files changed, 0 insertions(+), 48 deletions(-) | |
15 | ||
16 | Index: linux-2.6.27-ocfs2/fs/ocfs2/xattr.c | |
17 | =================================================================== | |
18 | --- linux-2.6.27-ocfs2.orig/fs/ocfs2/xattr.c | |
19 | +++ linux-2.6.27-ocfs2/fs/ocfs2/xattr.c | |
20 | @@ -1792,52 +1792,6 @@ cleanup: | |
21 | } | |
22 | ||
23 | /* | |
24 | - * When all the xattrs are deleted from index btree, the ocfs2_xattr_tree | |
25 | - * will be erased and ocfs2_xattr_block will have its ocfs2_xattr_header | |
26 | - * re-initialized. | |
27 | - */ | |
28 | -static int ocfs2_restore_xattr_block(struct inode *inode, | |
29 | - struct ocfs2_xattr_search *xs) | |
30 | -{ | |
31 | - int ret; | |
32 | - handle_t *handle; | |
33 | - struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | |
34 | - struct ocfs2_xattr_block *xb = | |
35 | - (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; | |
36 | - struct ocfs2_extent_list *el = &xb->xb_attrs.xb_root.xt_list; | |
37 | - u16 xb_flags = le16_to_cpu(xb->xb_flags); | |
38 | - | |
39 | - BUG_ON(!(xb_flags & OCFS2_XATTR_INDEXED) || | |
40 | - le16_to_cpu(el->l_next_free_rec) != 0); | |
41 | - | |
42 | - handle = ocfs2_start_trans(osb, OCFS2_XATTR_BLOCK_UPDATE_CREDITS); | |
43 | - if (IS_ERR(handle)) { | |
44 | - ret = PTR_ERR(handle); | |
45 | - handle = NULL; | |
46 | - goto out; | |
47 | - } | |
48 | - | |
49 | - ret = ocfs2_journal_access(handle, inode, xs->xattr_bh, | |
50 | - OCFS2_JOURNAL_ACCESS_WRITE); | |
51 | - if (ret < 0) { | |
52 | - mlog_errno(ret); | |
53 | - goto out_commit; | |
54 | - } | |
55 | - | |
56 | - memset(&xb->xb_attrs, 0, inode->i_sb->s_blocksize - | |
57 | - offsetof(struct ocfs2_xattr_block, xb_attrs)); | |
58 | - | |
59 | - xb->xb_flags = cpu_to_le16(xb_flags & ~OCFS2_XATTR_INDEXED); | |
60 | - | |
61 | - ocfs2_journal_dirty(handle, xs->xattr_bh); | |
62 | - | |
63 | -out_commit: | |
64 | - ocfs2_commit_trans(osb, handle); | |
65 | -out: | |
66 | - return ret; | |
67 | -} | |
68 | - | |
69 | -/* | |
70 | * ocfs2_xattr_block_set() | |
71 | * | |
72 | * Set, replace or remove an extended attribute into external block. | |
73 | @@ -1947,8 +1901,6 @@ out: | |
74 | } | |
75 | ||
76 | ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs); | |
77 | - if (!ret && xblk->xb_attrs.xb_root.xt_list.l_next_free_rec == 0) | |
78 | - ret = ocfs2_restore_xattr_block(inode, xs); | |
79 | ||
80 | end: | |
81 |