~wb-munzinger/+junk/ocfs2-tools

« back to all changes in this revision

Viewing changes to tunefs.ocfs2/feature_xattr.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2011-01-14 12:46:49 UTC
  • mfrom: (1.1.10 upstream) (0.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110114124649-vbe5qz211f3zxwuf
Tags: 1.6.3-1ubuntu1
* Merge from debian unstable (LP: #703008).  Remaining changes:
  - Fix configure tests for ld --as-needed.
  - Fix build failure with ld --no-add-needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        }
52
52
}
53
53
 
54
 
static errcode_t remove_xattr_entry(ocfs2_filesys *fs,
 
54
static errcode_t remove_xattr_entry(ocfs2_filesys *fs, uint64_t ino,
55
55
                                    struct ocfs2_xattr_header *xh)
56
56
{
57
57
        int i;
65
65
                                (struct ocfs2_xattr_value_root *)
66
66
                                ((void *)xh + xe->xe_name_offset +
67
67
                                OCFS2_XATTR_SIZE(xe->xe_name_len));
68
 
                        ret = ocfs2_xattr_value_truncate(fs, xv);
 
68
                        ret = ocfs2_xattr_value_truncate(fs, ino, xv);
69
69
                        if (ret)
70
70
                                break;
71
71
                }
75
75
}
76
76
 
77
77
static errcode_t remove_xattr_buckets(ocfs2_filesys *fs,
 
78
                                      uint64_t ino,
78
79
                                      uint64_t blkno,
79
80
                                      uint32_t clusters)
80
81
{
109
110
                if (i == 0)
110
111
                        num_buckets = xh->xh_num_buckets;
111
112
 
112
 
                ret = remove_xattr_entry(fs, xh);
 
113
                ret = remove_xattr_entry(fs, ino, xh);
113
114
                if (ret)
114
115
                        break;
115
116
        }
121
122
}
122
123
 
123
124
 
124
 
static errcode_t remove_xattr_index_block(ocfs2_filesys *fs,
 
125
static errcode_t remove_xattr_index_block(ocfs2_filesys *fs, uint64_t ino,
125
126
                                          struct ocfs2_xattr_block *xb)
126
127
{
127
128
        struct ocfs2_extent_list *el = &xb->xb_attrs.xb_root.xt_list;
141
142
                        goto out;
142
143
                }
143
144
 
144
 
                ret = remove_xattr_buckets(fs, p_blkno, num_clusters);
 
145
                ret = remove_xattr_buckets(fs, ino, p_blkno, num_clusters);
145
146
                if (ret) {
146
147
                        tcom_err(ret, "while iterating bucket"
147
148
                                 " of extended attributes ");
184
185
        if (!(xb->xb_flags & OCFS2_XATTR_INDEXED)) {
185
186
                struct ocfs2_xattr_header *xh = &xb->xb_attrs.xb_header;
186
187
 
187
 
                ret = remove_xattr_entry(fs, xh);
 
188
                ret = remove_xattr_entry(fs, di->i_blkno, xh);
188
189
                if (ret) {
189
190
                        tcom_err(ret, "while trying to remove extended"
190
191
                                 " attributes in external block ");
191
192
                        goto out;
192
193
                }
193
194
        } else {
194
 
                ret = remove_xattr_index_block(fs, xb);
 
195
                ret = remove_xattr_index_block(fs, di->i_blkno, xb);
195
196
                if (ret) {
196
197
                        tcom_err(ret, "while trying to remove extended"
197
198
                                 " attributes in index block ");
229
230
                 ((void *)di + fs->fs_blocksize -
230
231
                  di->i_xattr_inline_size);
231
232
 
232
 
        ret = remove_xattr_entry(fs, xh);
 
233
        ret = remove_xattr_entry(fs, di->i_blkno, xh);
233
234
        if (ret) {
234
235
                tcom_err(ret, "while trying to remove extended"
235
236
                         " attributes in ibody ");