aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:02 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:28 -0500
commit759bfee658beab14af7b357156461d0eb852be2c (patch)
tree180cdedd004781ee67c30ce89951324d32910067 /fs/jfs/file.c
parent63936ddaa16b9486e2d426ed7b09f559a5c60f87 (diff)
dquot: move dquot transfer responsibility into the filesystem
Currently notify_change calls vfs_dq_transfer directly. This means we tie the quota code into the VFS. Get rid of that and make the filesystem responsible for the transfer. Most filesystems already do this, only ufs and udf need the code added, and for jfs it needs to be enabled unconditionally instead of only when ACLs are enabled. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/jfs/file.c')
-rw-r--r--fs/jfs/file.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 2b70fa78e4a7..a4229e49330e 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/quotaops.h>
21#include "jfs_incore.h" 22#include "jfs_incore.h"
22#include "jfs_inode.h" 23#include "jfs_inode.h"
23#include "jfs_dmap.h" 24#include "jfs_dmap.h"
@@ -88,14 +89,37 @@ static int jfs_release(struct inode *inode, struct file *file)
88 return 0; 89 return 0;
89} 90}
90 91
92int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
93{
94 struct inode *inode = dentry->d_inode;
95 int rc;
96
97 rc = inode_change_ok(inode, iattr);
98 if (rc)
99 return rc;
100
101 if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
102 (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
103 if (vfs_dq_transfer(inode, iattr))
104 return -EDQUOT;
105 }
106
107 rc = inode_setattr(inode, iattr);
108
109 if (!rc && (iattr->ia_valid & ATTR_MODE))
110 rc = jfs_acl_chmod(inode);
111
112 return rc;
113}
114
91const struct inode_operations jfs_file_inode_operations = { 115const struct inode_operations jfs_file_inode_operations = {
92 .truncate = jfs_truncate, 116 .truncate = jfs_truncate,
93 .setxattr = jfs_setxattr, 117 .setxattr = jfs_setxattr,
94 .getxattr = jfs_getxattr, 118 .getxattr = jfs_getxattr,
95 .listxattr = jfs_listxattr, 119 .listxattr = jfs_listxattr,
96 .removexattr = jfs_removexattr, 120 .removexattr = jfs_removexattr,
97#ifdef CONFIG_JFS_POSIX_ACL
98 .setattr = jfs_setattr, 121 .setattr = jfs_setattr,
122#ifdef CONFIG_JFS_POSIX_ACL
99 .check_acl = jfs_check_acl, 123 .check_acl = jfs_check_acl,
100#endif 124#endif
101}; 125};