aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-05 16:20:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-05 16:20:53 -0500
commite213e26ab3988c516c06eba4dcd030ac052f6dc9 (patch)
tree6e26fbdbb842b387697d73daf6e70cf718269a77 /fs/jfs/file.c
parentc812a51d11bbe983f4c24e32b59b265705ddd3c2 (diff)
parentefd8f0e6f6c1faa041f228d7113bd3a9db802d49 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (33 commits) quota: stop using QUOTA_OK / NO_QUOTA dquot: cleanup dquot initialize routine dquot: move dquot initialization responsibility into the filesystem dquot: cleanup dquot drop routine dquot: move dquot drop responsibility into the filesystem dquot: cleanup dquot transfer routine dquot: move dquot transfer responsibility into the filesystem dquot: cleanup inode allocation / freeing routines dquot: cleanup space allocation / freeing routines ext3: add writepage sanity checks ext3: Truncate allocated blocks if direct IO write fails to update i_size quota: Properly invalidate caches even for filesystems with blocksize < pagesize quota: generalize quota transfer interface quota: sb_quota state flags cleanup jbd: Delay discarding buffers in journal_unmap_buffer ext3: quota_write cross block boundary behaviour quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota quota: split out compat_sys_quotactl support from quota.c quota: split out netlink notification support from quota.c quota: remove invalid optimization from quota_sync_all ... Fixed trivial conflicts in fs/namei.c and fs/ufs/inode.c
Diffstat (limited to 'fs/jfs/file.c')
-rw-r--r--fs/jfs/file.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 2b70fa78e4a7..14ba982b3f24 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"
@@ -47,7 +48,7 @@ static int jfs_open(struct inode *inode, struct file *file)
47{ 48{
48 int rc; 49 int rc;
49 50
50 if ((rc = generic_file_open(inode, file))) 51 if ((rc = dquot_file_open(inode, file)))
51 return rc; 52 return rc;
52 53
53 /* 54 /*
@@ -88,14 +89,40 @@ 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_SIZE)
102 dquot_initialize(inode);
103 if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
104 (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
105 rc = dquot_transfer(inode, iattr);
106 if (rc)
107 return rc;
108 }
109
110 rc = inode_setattr(inode, iattr);
111
112 if (!rc && (iattr->ia_valid & ATTR_MODE))
113 rc = jfs_acl_chmod(inode);
114
115 return rc;
116}
117
91const struct inode_operations jfs_file_inode_operations = { 118const struct inode_operations jfs_file_inode_operations = {
92 .truncate = jfs_truncate, 119 .truncate = jfs_truncate,
93 .setxattr = jfs_setxattr, 120 .setxattr = jfs_setxattr,
94 .getxattr = jfs_getxattr, 121 .getxattr = jfs_getxattr,
95 .listxattr = jfs_listxattr, 122 .listxattr = jfs_listxattr,
96 .removexattr = jfs_removexattr, 123 .removexattr = jfs_removexattr,
97#ifdef CONFIG_JFS_POSIX_ACL
98 .setattr = jfs_setattr, 124 .setattr = jfs_setattr,
125#ifdef CONFIG_JFS_POSIX_ACL
99 .check_acl = jfs_check_acl, 126 .check_acl = jfs_check_acl,
100#endif 127#endif
101}; 128};