aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/Kconfig1
-rw-r--r--fs/btrfs/acl.c47
-rw-r--r--fs/btrfs/extent_map.c2
-rw-r--r--fs/btrfs/file.c4
4 files changed, 16 insertions, 38 deletions
diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index 7bb3c020e570..402afe0a0bfb 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -4,6 +4,7 @@ config BTRFS_FS
4 select LIBCRC32C 4 select LIBCRC32C
5 select ZLIB_INFLATE 5 select ZLIB_INFLATE
6 select ZLIB_DEFLATE 6 select ZLIB_DEFLATE
7 select FS_JOURNAL_INFO
7 help 8 help
8 Btrfs is a new filesystem with extents, writable snapshotting, 9 Btrfs is a new filesystem with extents, writable snapshotting,
9 support for multiple devices and many more features. 10 support for multiple devices and many more features.
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 1898f8555f06..2e9e69987a82 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);
@@ -151,8 +151,8 @@ out:
151 return ret; 151 return ret;
152} 152}
153 153
154static int btrfs_xattr_set_acl(struct inode *inode, int type, 154static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
155 const void *value, size_t size) 155 const void *value, size_t size, int flags, int type)
156{ 156{
157 int ret; 157 int ret;
158 struct posix_acl *acl = NULL; 158 struct posix_acl *acl = NULL;
@@ -167,38 +167,13 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type,
167 } 167 }
168 } 168 }
169 169
170 ret = btrfs_set_acl(NULL, inode, acl, type); 170 ret = btrfs_set_acl(NULL, dentry->d_inode, acl, type);
171 171
172 posix_acl_release(acl); 172 posix_acl_release(acl);
173 173
174 return ret; 174 return ret;
175} 175}
176 176
177
178static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name,
179 void *value, size_t size)
180{
181 return btrfs_xattr_get_acl(inode, ACL_TYPE_ACCESS, value, size);
182}
183
184static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name,
185 const void *value, size_t size, int flags)
186{
187 return btrfs_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size);
188}
189
190static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
191 void *value, size_t size)
192{
193 return btrfs_xattr_get_acl(inode, ACL_TYPE_DEFAULT, value, size);
194}
195
196static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
197 const void *value, size_t size, int flags)
198{
199 return btrfs_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size);
200}
201
202int btrfs_check_acl(struct inode *inode, int mask) 177int btrfs_check_acl(struct inode *inode, int mask)
203{ 178{
204 struct posix_acl *acl; 179 struct posix_acl *acl;
@@ -305,14 +280,16 @@ int btrfs_acl_chmod(struct inode *inode)
305 280
306struct xattr_handler btrfs_xattr_acl_default_handler = { 281struct xattr_handler btrfs_xattr_acl_default_handler = {
307 .prefix = POSIX_ACL_XATTR_DEFAULT, 282 .prefix = POSIX_ACL_XATTR_DEFAULT,
308 .get = btrfs_xattr_acl_default_get, 283 .flags = ACL_TYPE_DEFAULT,
309 .set = btrfs_xattr_acl_default_set, 284 .get = btrfs_xattr_acl_get,
285 .set = btrfs_xattr_acl_set,
310}; 286};
311 287
312struct xattr_handler btrfs_xattr_acl_access_handler = { 288struct xattr_handler btrfs_xattr_acl_access_handler = {
313 .prefix = POSIX_ACL_XATTR_ACCESS, 289 .prefix = POSIX_ACL_XATTR_ACCESS,
314 .get = btrfs_xattr_acl_access_get, 290 .flags = ACL_TYPE_ACCESS,
315 .set = btrfs_xattr_acl_access_set, 291 .get = btrfs_xattr_acl_get,
292 .set = btrfs_xattr_acl_set,
316}; 293};
317 294
318#else /* CONFIG_BTRFS_FS_POSIX_ACL */ 295#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 3bfe9f03990b..feaa13b105d9 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -772,7 +772,7 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
772 unsigned long last_index; 772 unsigned long last_index;
773 int will_write; 773 int will_write;
774 774
775 will_write = ((file->f_flags & O_SYNC) || IS_SYNC(inode) || 775 will_write = ((file->f_flags & O_DSYNC) || IS_SYNC(inode) ||
776 (file->f_flags & O_DIRECT)); 776 (file->f_flags & O_DIRECT));
777 777
778 nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE, 778 nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE,
@@ -939,7 +939,7 @@ out_nolock:
939 if (err) 939 if (err)
940 num_written = err; 940 num_written = err;
941 941
942 if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) { 942 if ((file->f_flags & O_DSYNC) || IS_SYNC(inode)) {
943 trans = btrfs_start_transaction(root, 1); 943 trans = btrfs_start_transaction(root, 1);
944 ret = btrfs_log_dentry_safe(trans, root, 944 ret = btrfs_log_dentry_safe(trans, root,
945 file->f_dentry); 945 file->f_dentry);