diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-12-20 10:56:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 20:02:47 -0500 |
commit | af53d29ac13a97304d44343dc3b26154ca595268 (patch) | |
tree | 6ed2ca27a8d9d1d04b3df839273f36c896cf370e /fs/btrfs | |
parent | ba87167c06ed0049260d9ca36405c0f8af609e07 (diff) |
switch btrfs, close races
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/export.c | 12 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 2 | ||||
-rw-r--r-- | fs/btrfs/super.c | 1 |
3 files changed, 3 insertions, 12 deletions
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index 0ccf9a8afcdf..9786963b07e5 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c | |||
@@ -65,7 +65,6 @@ static struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid, | |||
65 | { | 65 | { |
66 | struct btrfs_fs_info *fs_info = btrfs_sb(sb)->fs_info; | 66 | struct btrfs_fs_info *fs_info = btrfs_sb(sb)->fs_info; |
67 | struct btrfs_root *root; | 67 | struct btrfs_root *root; |
68 | struct dentry *dentry; | ||
69 | struct inode *inode; | 68 | struct inode *inode; |
70 | struct btrfs_key key; | 69 | struct btrfs_key key; |
71 | int index; | 70 | int index; |
@@ -108,10 +107,7 @@ static struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid, | |||
108 | return ERR_PTR(-ESTALE); | 107 | return ERR_PTR(-ESTALE); |
109 | } | 108 | } |
110 | 109 | ||
111 | dentry = d_obtain_alias(inode); | 110 | return d_obtain_alias(inode); |
112 | if (!IS_ERR(dentry)) | ||
113 | d_set_d_op(dentry, &btrfs_dentry_operations); | ||
114 | return dentry; | ||
115 | fail: | 111 | fail: |
116 | srcu_read_unlock(&fs_info->subvol_srcu, index); | 112 | srcu_read_unlock(&fs_info->subvol_srcu, index); |
117 | return ERR_PTR(err); | 113 | return ERR_PTR(err); |
@@ -166,7 +162,6 @@ static struct dentry *btrfs_fh_to_dentry(struct super_block *sb, struct fid *fh, | |||
166 | static struct dentry *btrfs_get_parent(struct dentry *child) | 162 | static struct dentry *btrfs_get_parent(struct dentry *child) |
167 | { | 163 | { |
168 | struct inode *dir = child->d_inode; | 164 | struct inode *dir = child->d_inode; |
169 | struct dentry *dentry; | ||
170 | struct btrfs_root *root = BTRFS_I(dir)->root; | 165 | struct btrfs_root *root = BTRFS_I(dir)->root; |
171 | struct btrfs_path *path; | 166 | struct btrfs_path *path; |
172 | struct extent_buffer *leaf; | 167 | struct extent_buffer *leaf; |
@@ -223,10 +218,7 @@ static struct dentry *btrfs_get_parent(struct dentry *child) | |||
223 | 218 | ||
224 | key.type = BTRFS_INODE_ITEM_KEY; | 219 | key.type = BTRFS_INODE_ITEM_KEY; |
225 | key.offset = 0; | 220 | key.offset = 0; |
226 | dentry = d_obtain_alias(btrfs_iget(root->fs_info->sb, &key, root, NULL)); | 221 | return d_obtain_alias(btrfs_iget(root->fs_info->sb, &key, root, NULL)); |
227 | if (!IS_ERR(dentry)) | ||
228 | d_set_d_op(dentry, &btrfs_dentry_operations); | ||
229 | return dentry; | ||
230 | fail: | 222 | fail: |
231 | btrfs_free_path(path); | 223 | btrfs_free_path(path); |
232 | return ERR_PTR(ret); | 224 | return ERR_PTR(ret); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a0ff46a47895..f870aefc59dd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4084,8 +4084,6 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) | |||
4084 | int index; | 4084 | int index; |
4085 | int ret; | 4085 | int ret; |
4086 | 4086 | ||
4087 | d_set_d_op(dentry, &btrfs_dentry_operations); | ||
4088 | |||
4089 | if (dentry->d_name.len > BTRFS_NAME_LEN) | 4087 | if (dentry->d_name.len > BTRFS_NAME_LEN) |
4090 | return ERR_PTR(-ENAMETOOLONG); | 4088 | return ERR_PTR(-ENAMETOOLONG); |
4091 | 4089 | ||
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 883c6fa1367e..22acdaa78ce1 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -460,6 +460,7 @@ static int btrfs_fill_super(struct super_block *sb, | |||
460 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 460 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
461 | sb->s_magic = BTRFS_SUPER_MAGIC; | 461 | sb->s_magic = BTRFS_SUPER_MAGIC; |
462 | sb->s_op = &btrfs_super_ops; | 462 | sb->s_op = &btrfs_super_ops; |
463 | sb->s_d_op = &btrfs_dentry_operations; | ||
463 | sb->s_export_op = &btrfs_export_ops; | 464 | sb->s_export_op = &btrfs_export_ops; |
464 | sb->s_xattr = btrfs_xattr_handlers; | 465 | sb->s_xattr = btrfs_xattr_handlers; |
465 | sb->s_time_gran = 1; | 466 | sb->s_time_gran = 1; |