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/ctree.h2
-rw-r--r--fs/btrfs/extent_map.c2
-rw-r--r--fs/btrfs/file.c4
-rw-r--r--fs/btrfs/inode.c4
-rw-r--r--fs/btrfs/sysfs.c4
6 files changed, 20 insertions, 43 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/ctree.h b/fs/btrfs/ctree.h
index 11115847d875..0af2e3868573 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2328,7 +2328,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
2328int btrfs_readpage(struct file *file, struct page *page); 2328int btrfs_readpage(struct file *file, struct page *page);
2329void btrfs_delete_inode(struct inode *inode); 2329void btrfs_delete_inode(struct inode *inode);
2330void btrfs_put_inode(struct inode *inode); 2330void btrfs_put_inode(struct inode *inode);
2331int btrfs_write_inode(struct inode *inode, int wait); 2331int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
2332void btrfs_dirty_inode(struct inode *inode); 2332void btrfs_dirty_inode(struct inode *inode);
2333struct inode *btrfs_alloc_inode(struct super_block *sb); 2333struct inode *btrfs_alloc_inode(struct super_block *sb);
2334void btrfs_destroy_inode(struct inode *inode); 2334void btrfs_destroy_inode(struct inode *inode);
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 5a01f35507dd..28d87ba60ce8 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 d146dde7efb6..ee3323c7fc1c 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -839,7 +839,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
839 unsigned long last_index; 839 unsigned long last_index;
840 int will_write; 840 int will_write;
841 841
842 will_write = ((file->f_flags & O_SYNC) || IS_SYNC(inode) || 842 will_write = ((file->f_flags & O_DSYNC) || IS_SYNC(inode) ||
843 (file->f_flags & O_DIRECT)); 843 (file->f_flags & O_DIRECT));
844 844
845 nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE, 845 nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE,
@@ -1006,7 +1006,7 @@ out_nolock:
1006 if (err) 1006 if (err)
1007 num_written = err; 1007 num_written = err;
1008 1008
1009 if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) { 1009 if ((file->f_flags & O_DSYNC) || IS_SYNC(inode)) {
1010 trans = btrfs_start_transaction(root, 1); 1010 trans = btrfs_start_transaction(root, 1);
1011 ret = btrfs_log_dentry_safe(trans, root, 1011 ret = btrfs_log_dentry_safe(trans, root,
1012 file->f_dentry); 1012 file->f_dentry);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2a337a09c650..02bb099845fd 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3990,7 +3990,7 @@ err:
3990 return ret; 3990 return ret;
3991} 3991}
3992 3992
3993int btrfs_write_inode(struct inode *inode, int wait) 3993int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc)
3994{ 3994{
3995 struct btrfs_root *root = BTRFS_I(inode)->root; 3995 struct btrfs_root *root = BTRFS_I(inode)->root;
3996 struct btrfs_trans_handle *trans; 3996 struct btrfs_trans_handle *trans;
@@ -3999,7 +3999,7 @@ int btrfs_write_inode(struct inode *inode, int wait)
3999 if (root->fs_info->btree_inode == inode) 3999 if (root->fs_info->btree_inode == inode)
4000 return 0; 4000 return 0;
4001 4001
4002 if (wait) { 4002 if (wbc->sync_mode == WB_SYNC_ALL) {
4003 trans = btrfs_join_transaction(root, 1); 4003 trans = btrfs_join_transaction(root, 1);
4004 btrfs_set_trans_block_group(trans, inode); 4004 btrfs_set_trans_block_group(trans, inode);
4005 ret = btrfs_commit_transaction(trans, root); 4005 ret = btrfs_commit_transaction(trans, root);
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index a240b6fa81df..4ce16ef702a3 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -164,12 +164,12 @@ static void btrfs_root_release(struct kobject *kobj)
164 complete(&root->kobj_unregister); 164 complete(&root->kobj_unregister);
165} 165}
166 166
167static struct sysfs_ops btrfs_super_attr_ops = { 167static const struct sysfs_ops btrfs_super_attr_ops = {
168 .show = btrfs_super_attr_show, 168 .show = btrfs_super_attr_show,
169 .store = btrfs_super_attr_store, 169 .store = btrfs_super_attr_store,
170}; 170};
171 171
172static struct sysfs_ops btrfs_root_attr_ops = { 172static const struct sysfs_ops btrfs_root_attr_ops = {
173 .show = btrfs_root_attr_show, 173 .show = btrfs_root_attr_show,
174 .store = btrfs_root_attr_store, 174 .store = btrfs_root_attr_store,
175}; 175};