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 fa44e92e9b8f..54f4798ab46a 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;
@@ -307,14 +282,16 @@ int btrfs_acl_chmod(struct inode *inode)
307 282
308struct xattr_handler btrfs_xattr_acl_default_handler = { 283struct xattr_handler btrfs_xattr_acl_default_handler = {
309 .prefix = POSIX_ACL_XATTR_DEFAULT, 284 .prefix = POSIX_ACL_XATTR_DEFAULT,
310 .get = btrfs_xattr_acl_default_get, 285 .flags = ACL_TYPE_DEFAULT,
311 .set = btrfs_xattr_acl_default_set, 286 .get = btrfs_xattr_acl_get,
287 .set = btrfs_xattr_acl_set,
312}; 288};
313 289
314struct xattr_handler btrfs_xattr_acl_access_handler = { 290struct xattr_handler btrfs_xattr_acl_access_handler = {
315 .prefix = POSIX_ACL_XATTR_ACCESS, 291 .prefix = POSIX_ACL_XATTR_ACCESS,
316 .get = btrfs_xattr_acl_access_get, 292 .flags = ACL_TYPE_ACCESS,
317 .set = btrfs_xattr_acl_access_set, 293 .get = btrfs_xattr_acl_get,
294 .set = btrfs_xattr_acl_set,
318}; 295};
319 296
320#else /* CONFIG_BTRFS_FS_POSIX_ACL */ 297#else /* CONFIG_BTRFS_FS_POSIX_ACL */
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index ccbdcb54ec5d..46bea0f4dc7b 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -256,7 +256,7 @@ out:
256 * Insert @em into @tree or perform a simple forward/backward merge with 256 * Insert @em into @tree or perform a simple forward/backward merge with
257 * existing mappings. The extent_map struct passed in will be inserted 257 * existing mappings. The extent_map struct passed in will be inserted
258 * into the tree directly, with an additional reference taken, or a 258 * into the tree directly, with an additional reference taken, or a
259 * reference dropped if the merge attempt was sucessfull. 259 * reference dropped if the merge attempt was successfull.
260 */ 260 */
261int add_extent_mapping(struct extent_map_tree *tree, 261int add_extent_mapping(struct extent_map_tree *tree,
262 struct extent_map *em) 262 struct extent_map *em)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index ae96fdae1f7d..c02033596f02 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);