]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/reiserfs/ioctl.c
fs/reiserfs/: cleanups
[linux-2.6-omap-h63xx.git] / fs / reiserfs / ioctl.c
index b484d2913c0dc18389fe242fd9c1568d578dd82f..c438a8f83f26f7ad3412f5fd2f3af69e582ad02d 100644 (file)
@@ -51,8 +51,7 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
                        if (IS_RDONLY(inode))
                                return -EROFS;
 
-                       if ((current->fsuid != inode->i_uid)
-                           && !capable(CAP_FOWNER))
+                       if (!is_owner_or_cap(inode))
                                return -EPERM;
 
                        if (get_user(flags, (int __user *)arg))
@@ -81,7 +80,7 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
        case REISERFS_IOC_GETVERSION:
                return put_user(inode->i_generation, (int __user *)arg);
        case REISERFS_IOC_SETVERSION:
-               if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+               if (!is_owner_or_cap(inode))
                        return -EPERM;
                if (IS_RDONLY(inode))
                        return -EROFS;
@@ -129,6 +128,10 @@ long reiserfs_compat_ioctl(struct file *file, unsigned int cmd,
 }
 #endif
 
+int reiserfs_commit_write(struct file *f, struct page *page,
+                         unsigned from, unsigned to);
+int reiserfs_prepare_write(struct file *f, struct page *page,
+                          unsigned from, unsigned to);
 /*
 ** reiserfs_unpack
 ** Function try to convert tail from direct item into indirect.
@@ -176,15 +179,13 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
        if (!page) {
                goto out;
        }
-       retval =
-           mapping->a_ops->prepare_write(NULL, page, write_from, write_from);
+       retval = reiserfs_prepare_write(NULL, page, write_from, write_from);
        if (retval)
                goto out_unlock;
 
        /* conversion can change page contents, must flush */
        flush_dcache_page(page);
-       retval =
-           mapping->a_ops->commit_write(NULL, page, write_from, write_from);
+       retval = reiserfs_commit_write(NULL, page, write_from, write_from);
        REISERFS_I(inode)->i_flags |= i_nopack_mask;
 
       out_unlock: