From 0903353a149ea25fa1cd7e05ccb6ae4a30c09966 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Sat, 1 Feb 2014 16:02:02 +0800 Subject: ext2: Add __init macro to init_inodecache init_inodecache is only called by __init init_ext2_fs. Signed-off-by: Fabian Frederick Signed-off-by: Jan Kara --- fs/ext2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ext2') diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 20d6697bd638..73d80da25acd 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -192,7 +192,7 @@ static void init_once(void *foo) inode_init_once(&ei->vfs_inode); } -static int init_inodecache(void) +static int __init init_inodecache(void) { ext2_inode_cachep = kmem_cache_create("ext2_inode_cache", sizeof(struct ext2_inode_info), -- cgit v1.2.3-59-g8ed1b From 17cd48e488c0a07186ad35af2a02738cfc1c1229 Mon Sep 17 00:00:00 2001 From: Rashika Kheria Date: Sun, 9 Feb 2014 18:34:10 +0530 Subject: fs: Mark function as static in ext2/xattr_security.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mark function as static in ext2/xattr_security.c because it is not used outside this file. This also elimiantes the following warning in ext2/xattr_security.c: fs/ext2/xattr_security.c:45:5: warning: no previous prototype for ‘ext2_initxattrs’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria Reviewed-by: Josh Triplett Signed-off-by: Jan Kara --- fs/ext2/xattr_security.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/ext2') diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c index cfedb2cb0d8c..c0ebc4db8849 100644 --- a/fs/ext2/xattr_security.c +++ b/fs/ext2/xattr_security.c @@ -42,8 +42,8 @@ ext2_xattr_security_set(struct dentry *dentry, const char *name, value, size, flags); } -int ext2_initxattrs(struct inode *inode, const struct xattr *xattr_array, - void *fs_info) +static int ext2_initxattrs(struct inode *inode, const struct xattr *xattr_array, + void *fs_info) { const struct xattr *xattr; int err = 0; -- cgit v1.2.3-59-g8ed1b From e878167af92fda03eb3a8597eec24128d4d47c43 Mon Sep 17 00:00:00 2001 From: ZhangZhen Date: Wed, 26 Feb 2014 10:32:41 +0800 Subject: ext2/3: use prandom_u32() instead of get_random_bytes() Many of the uses of get_random_bytes() do not actually need cryptographically secure random numbers. Replace those uses with a call to prandom_u32(), which is faster and which doesn't consume entropy from the /dev/random driver. The commit dd1f723bf56bd96efc9d90e9e60dc511c79de48f has made that for ext4, and i did the same for ext2/3. Signed-off-by: Zhang Zhen Signed-off-by: Jan Kara --- fs/ext2/ialloc.c | 2 +- fs/ext3/ialloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/ext2') diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 7cadd823bb31..7d66fb0e4cca 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -284,7 +284,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) int best_ndir = inodes_per_group; int best_group = -1; - get_random_bytes(&group, sizeof(group)); + group = prandom_u32(); parent_group = (unsigned)group % ngroups; for (i = 0; i < ngroups; i++) { group = (parent_group + i) % ngroups; diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index 082afd78b107..a1b810230cc5 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c @@ -215,7 +215,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) int best_ndir = inodes_per_group; int best_group = -1; - get_random_bytes(&group, sizeof(group)); + group = prandom_u32(); parent_group = (unsigned)group % ngroups; for (i = 0; i < ngroups; i++) { group = (parent_group + i) % ngroups; -- cgit v1.2.3-59-g8ed1b From 3e0d8a01043ded18711fe4a0a320e4491f580ce1 Mon Sep 17 00:00:00 2001 From: Jakub Sitnicki Date: Mon, 24 Mar 2014 08:21:24 +0100 Subject: ext2: acl: remove unneeded include of linux/capability.h acl.c has not been (directly) using the interface defined by linux/capability.h header since commit 3bd858ab1c451725c07a ("Introduce is_owner_or_cap() to wrap CAP_FOWNER use with fsuid check"). Remove it. Signed-off-by: Jakub Sitnicki Signed-off-by: Jan Kara --- fs/ext2/acl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'fs/ext2') diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 1b8001bbe947..27695e6f4e46 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c @@ -4,7 +4,6 @@ * Copyright (C) 2001-2003 Andreas Gruenbacher, */ -#include #include #include #include -- cgit v1.2.3-59-g8ed1b