ext2 cleanup: ext2_permission() is exactly identical to permission()

Pavel Machek (pavel@suse.cz)
Sun, 12 Dec 1999 23:27:11 +0100


Hi!

This is duplicated-code-kill.

Pavel

--- clean/fs/ext2/acl.c Sat Dec 11 21:43:59 1999
+++ linux/fs/ext2/acl.c Sun Dec 12 23:11:07 1999
@@ -15,46 +15,3 @@
* This file will contain the Access Control Lists management for the
* second extended file system.
*/
-
-
-/*
- * ext2_permission ()
- *
- * Check for access rights
- */
-int ext2_permission (struct inode * inode, int mask)
-{
- unsigned short mode = inode->i_mode;
-
- /*
- * Nobody gets write access to a file on a readonly-fs
- */
- if ((mask & S_IWOTH) &&
- (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) &&
- IS_RDONLY(inode))
- return -EROFS;
- /*
- * Nobody gets write access to an immutable file
- */
- if ((mask & S_IWOTH) && IS_IMMUTABLE(inode))
- return -EACCES;
-
- /*
- * If no ACL, checks using the file mode
- */
- else if (current->fsuid == inode->i_uid)
- mode >>= 6;
- else if (in_group_p (inode->i_gid))
- mode >>= 3;
- /*
- * Access is always granted for root. We now check last,
- * though, for BSD process accounting correctness
- */
- if (((mode & mask & S_IRWXO) == mask) || capable(CAP_DAC_OVERRIDE))
- return 0;
- if ((mask == S_IROTH) ||
- (S_ISDIR(mode) && !(mask & ~(S_IROTH | S_IXOTH))))
- if (capable(CAP_DAC_READ_SEARCH))
- return 0;
- return -EACCES;
-}
--- clean/fs/ext2/dir.c Sat Dec 11 21:43:59 1999
+++ linux/fs/ext2/dir.c Sun Dec 12 23:11:34 1999
@@ -67,7 +67,7 @@
NULL, /* readpage */
NULL, /* writepage */
NULL, /* truncate */
- ext2_permission, /* permission */
+ NULL, /* permission */
NULL /* revalidate */
};

--- clean/fs/ext2/file.c Sat Dec 11 21:43:59 1999
+++ linux/fs/ext2/file.c Sun Dec 12 23:11:42 1999
@@ -177,6 +177,6 @@
block_read_full_page, /* readpage */
block_write_full_page, /* writepage */
ext2_truncate, /* truncate */
- ext2_permission, /* permission */
+ NULL, /* permission */
NULL, /* revalidate */
};

Pavel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/