aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/acl.c47
-rw-r--r--fs/btrfs/extent_map.c2
-rw-r--r--fs/btrfs/file.c4
3 files changed, 15 insertions, 38 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index da3133c69830..6df6d6ed74fd 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -73,13 +73,13 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
73 return acl; 73 return acl;
74} 74}
75 75
76static int btrfs_xattr_get_acl(struct inode *inode, int type, 76static int btrfs_xattr_acl_get(struct dentry *dentry, const char *name,
77 void *value, size_t size) 77 void *value, size_t size, int type)
78{ 78{
79 struct posix_acl *acl; 79 struct posix_acl *acl;
80 int ret = 0; 80 int ret = 0;
81 81
82 acl = btrfs_get_acl(inode, type); 82 acl = btrfs_get_acl(dentry->d_inode, type);
83 83
84 if (IS_ERR(acl)) 84 if (IS_ERR(acl))
85 return PTR_ERR(acl); 85 return PTR_ERR(acl);
@@ -153,8 +153,8 @@ out:
153 return ret; 153 return ret;
154} 154}
155 155
156static int btrfs_xattr_set_acl(struct inode *inode, int type, 156static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
157 const void *value, size_t size) 157 const void *value, size_t size, int flags, int type)
158{ 158{
159 int ret; 159 int ret;
160 struct posix_acl *acl = NULL; 160 struct posix_acl *acl = NULL;
@@ -169,38 +169,13 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type,
169 } 169 }
170 } 170 }
171 171
172 ret = btrfs_set_acl(NULL, inode, acl, type); 172 ret = btrfs_set_acl(NULL, dentry->d_inode, acl, type);
173 173
174 posix_acl_release(acl); 174 posix_acl_release(acl);
175 175
176 return ret; 176 return ret;
177} 177}
178 178
179
180static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name,
181 void *value, size_t size)
182{
183 return btrfs_xattr_get_acl(inode, ACL_TYPE_ACCESS, value, size);
184}
185
186static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name,
187 const void *value, size_t size, int flags)
188{
189 return btrfs_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size);
190}
191
192static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
193 void *value, size_t size)
194{
195 return btrfs_xattr_get_acl(inode, ACL_TYPE_DEFAULT, value, size);
196}
197
198static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
199 const void *value, size_t size, int flags)
200{
201 return btrfs_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size);
202}
203
204int btrfs_check_acl(struct inode *inode, int mask) 179int btrfs_check_acl(struct inode *inode, int mask)
205{ 180{
206 struct posix_acl *acl; 181 struct posix_acl *acl;
@@ -308,14 +283,16 @@ int btrfs_acl_chmod(struct inode *inode)
308 283
309struct xattr_handler btrfs_xattr_acl_default_handler = { 284struct xattr_handler btrfs_xattr_acl_default_handler = {
310 .prefix = POSIX_ACL_XATTR_DEFAULT, 285 .prefix = POSIX_ACL_XATTR_DEFAULT,
311 .get = btrfs_xattr_acl_default_get, 286 .flags = ACL_TYPE_DEFAULT,
312 .set = btrfs_xattr_acl_default_set, 287 .get = btrfs_xattr_acl_get,
288 .set = btrfs_xattr_acl_set,
313}; 289};
314 290
315struct xattr_handler btrfs_xattr_acl_access_handler = { 291struct xattr_handler btrfs_xattr_acl_access_handler = {
316 .prefix = POSIX_ACL_XATTR_ACCESS, 292 .prefix = POSIX_ACL_XATTR_ACCESS,
317 .get = btrfs_xattr_acl_access_get, 293 .flags = ACL_TYPE_ACCESS,
318 .set = btrfs_xattr_acl_access_set, 294 .get = btrfs_xattr_acl_get,
295 .set = btrfs_xattr_acl_set,
319}; 296};
320 297
321#else /* CONFIG_BTRFS_FS_POSIX_ACL */ 298#else /* CONFIG_BTRFS_FS_POSIX_ACL */
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 5a4f73b79b75..428fcac45f90 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -242,7 +242,7 @@ out:
242 * Insert @em into @tree or perform a simple forward/backward merge with 242 * Insert @em into @tree or perform a simple forward/backward merge with
243 * existing mappings. The extent_map struct passed in will be inserted 243 * existing mappings. The extent_map struct passed in will be inserted
244 * into the tree directly, with an additional reference taken, or a 244 * into the tree directly, with an additional reference taken, or a
245 * reference dropped if the merge attempt was sucessfull. 245 * reference dropped if the merge attempt was successfull.
246 */ 246 */
247int add_extent_mapping(struct extent_map_tree *tree, 247int add_extent_mapping(struct extent_map_tree *tree,
248 struct extent_map *em) 248 struct extent_map *em)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 413a30dafcda..9d0809629967 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -832,7 +832,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
832 unsigned long last_index; 832 unsigned long last_index;
833 int will_write; 833 int will_write;
834 834
835 will_write = ((file->f_flags & O_SYNC) || IS_SYNC(inode) || 835 will_write = ((file->f_flags & O_DSYNC) || IS_SYNC(inode) ||
836 (file->f_flags & O_DIRECT)); 836 (file->f_flags & O_DIRECT));
837 837
838 nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE, 838 nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE,
@@ -999,7 +999,7 @@ out_nolock:
999 if (err) 999 if (err)
1000 num_written = err; 1000 num_written = err;
1001 1001
1002 if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) { 1002 if ((file->f_flags & O_DSYNC) || IS_SYNC(inode)) {
1003 trans = btrfs_start_transaction(root, 1); 1003 trans = btrfs_start_transaction(root, 1);
1004 ret = btrfs_log_dentry_safe(trans, root, 1004 ret = btrfs_log_dentry_safe(trans, root,
1005 file->f_dentry); 1005 file->f_dentry);