]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] hpfs: cleanup ->setattr
authorChristoph Hellwig <hch@lst.de>
Sun, 10 Aug 2008 22:27:59 +0000 (00:27 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 23 Oct 2008 09:12:58 +0000 (05:12 -0400)
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>
fs/hpfs/file.c
fs/hpfs/hpfs_fn.h
fs/hpfs/inode.c
fs/hpfs/namei.c

index be8be5040e073f81b4e31ad10d119824bbe8f457..64ab52259204b24f20aa356d60ab73b1df982346 100644 (file)
@@ -143,5 +143,5 @@ const struct file_operations hpfs_file_ops =
 const struct inode_operations hpfs_file_iops =
 {
        .truncate       = hpfs_truncate,
-       .setattr        = hpfs_notify_change,
+       .setattr        = hpfs_setattr,
 };
index 42ff60ccf2a9f63b50643da396b6918a67fa3e10..c2ea31bae313092dff76107889b79596cf7b417a 100644 (file)
@@ -275,7 +275,7 @@ void hpfs_init_inode(struct inode *);
 void hpfs_read_inode(struct inode *);
 void hpfs_write_inode(struct inode *);
 void hpfs_write_inode_nolock(struct inode *);
-int hpfs_notify_change(struct dentry *, struct iattr *);
+int hpfs_setattr(struct dentry *, struct iattr *);
 void hpfs_write_if_changed(struct inode *);
 void hpfs_delete_inode(struct inode *);
 
index 85d3e1d9ac000072df33c32b52da5e16394cc676..39a1bfbea3122ed430fdffcd38f5aab02d62b68f 100644 (file)
@@ -260,19 +260,28 @@ void hpfs_write_inode_nolock(struct inode *i)
        brelse(bh);
 }
 
-int hpfs_notify_change(struct dentry *dentry, struct iattr *attr)
+int hpfs_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = dentry->d_inode;
-       int error=0;
+       int error = -EINVAL;
+
        lock_kernel();
-       if ( ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) ||
-            (hpfs_sb(inode->i_sb)->sb_root == inode->i_ino) ) {
-               error = -EINVAL;
-       } else if ((error = inode_change_ok(inode, attr))) {
-       } else if ((error = inode_setattr(inode, attr))) {
-       } else {
-               hpfs_write_inode(inode);
-       }
+       if (inode->i_ino == hpfs_sb(inode->i_sb)->sb_root)
+               goto out_unlock;
+       if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size)
+               goto out_unlock;
+
+       error = inode_change_ok(inode, attr);
+       if (error)
+               goto out_unlock;
+
+       error = inode_setattr(inode, attr);
+       if (error)
+               goto out_unlock;
+
+       hpfs_write_inode(inode);
+
+ out_unlock:
        unlock_kernel();
        return error;
 }
index d9c59a775449ee9abfc27e24ed898ce17d05251a..10783f3d265abd8876502fa63bebad1be2f3be35 100644 (file)
@@ -669,5 +669,5 @@ const struct inode_operations hpfs_dir_iops =
        .rmdir          = hpfs_rmdir,
        .mknod          = hpfs_mknod,
        .rename         = hpfs_rename,
-       .setattr        = hpfs_notify_change,
+       .setattr        = hpfs_setattr,
 };