diff options
author | Christoph Hellwig <hch@lst.de> | 2008-08-10 18:27:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 05:12:58 -0400 |
commit | ca30bc99527ab968707bafc09e38807de7e70c4a (patch) | |
tree | 3d4ea649fb23c0a8e9075855e90f4824042ca305 /fs/hpfs/inode.c | |
parent | 72e8264eda02b6ba85a222b9620802ebf23c6a10 (diff) |
[PATCH] hpfs: cleanup ->setattr
Reformat hpfs_notify_change to standard kernel style to make it readable
and rename it to hpfs_setattr as that's what the method is called.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs/inode.c')
-rw-r--r-- | fs/hpfs/inode.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 85d3e1d9ac00..39a1bfbea312 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c | |||
@@ -260,19 +260,28 @@ void hpfs_write_inode_nolock(struct inode *i) | |||
260 | brelse(bh); | 260 | brelse(bh); |
261 | } | 261 | } |
262 | 262 | ||
263 | int hpfs_notify_change(struct dentry *dentry, struct iattr *attr) | 263 | int hpfs_setattr(struct dentry *dentry, struct iattr *attr) |
264 | { | 264 | { |
265 | struct inode *inode = dentry->d_inode; | 265 | struct inode *inode = dentry->d_inode; |
266 | int error=0; | 266 | int error = -EINVAL; |
267 | |||
267 | lock_kernel(); | 268 | lock_kernel(); |
268 | if ( ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) || | 269 | if (inode->i_ino == hpfs_sb(inode->i_sb)->sb_root) |
269 | (hpfs_sb(inode->i_sb)->sb_root == inode->i_ino) ) { | 270 | goto out_unlock; |
270 | error = -EINVAL; | 271 | if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) |
271 | } else if ((error = inode_change_ok(inode, attr))) { | 272 | goto out_unlock; |
272 | } else if ((error = inode_setattr(inode, attr))) { | 273 | |
273 | } else { | 274 | error = inode_change_ok(inode, attr); |
274 | hpfs_write_inode(inode); | 275 | if (error) |
275 | } | 276 | goto out_unlock; |
277 | |||
278 | error = inode_setattr(inode, attr); | ||
279 | if (error) | ||
280 | goto out_unlock; | ||
281 | |||
282 | hpfs_write_inode(inode); | ||
283 | |||
284 | out_unlock: | ||
276 | unlock_kernel(); | 285 | unlock_kernel(); |
277 | return error; | 286 | return error; |
278 | } | 287 | } |