ocfs2: Remove ocfs2_write_should_remove_suid()
authorMark Fasheh <mark.fasheh@oracle.com>
Wed, 18 Oct 2006 00:06:53 +0000 (17:06 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Sat, 2 Dec 2006 02:28:43 +0000 (18:28 -0800)
Use should_remove_suid() instead.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/file.c

index fe6b795b1a45e89c13326c268490e0902e12bd10..39b2f1653e2554387bece37f0f6bbc43ccaa81ed 100644 (file)
@@ -943,20 +943,6 @@ out:
        return ret;
 }
 
-static inline int ocfs2_write_should_remove_suid(struct inode *inode)
-{
-       mode_t mode = inode->i_mode;
-
-       if (!capable(CAP_FSETID)) {
-               if (unlikely(mode & S_ISUID))
-                       return 1;
-
-               if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
-                       return 1;
-       }
-       return 0;
-}
-
 static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
                                    const struct iovec *iov,
                                    unsigned long nr_segs,
@@ -1021,7 +1007,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
                 * inode. There's also the dinode i_size state which
                 * can be lost via setattr during extending writes (we
                 * set inode->i_size at the end of a write. */
-               if (ocfs2_write_should_remove_suid(inode)) {
+               if (should_remove_suid(filp->f_dentry)) {
                        if (meta_level == 0) {
                                ocfs2_meta_unlock(inode, meta_level);
                                meta_level = 1;