summaryrefslogtreecommitdiff
path: root/fs/coda/cnode.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2019-07-17 02:29:09 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-17 05:23:23 +0300
commit5bb44810f47a00b608ed2cb9f892ae7ce37b02bd (patch)
tree1e729c00a2c6ceee1b206d775b6a5defe74a3969 /fs/coda/cnode.c
parent7f6118ce95d2673f8c936dd47d9bbeb60f4d16ad (diff)
downloadlinux-5bb44810f47a00b608ed2cb9f892ae7ce37b02bd.tar.xz
coda: ftoc validity check integration
This patch moves cfi check in coda_ftoc() instead of repeating it in the wild. Module size text data bss dec hex filename 28297 1040 700 30037 7555 fs/coda/coda.ko.before 28263 980 700 29943 74f7 fs/coda/coda.ko.after Link: http://lkml.kernel.org/r/a2c27663ec4547018c92d71c63b1dff4650b6546.1558117389.git.jaharkes@cs.cmu.edu Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Colin Ian King <colin.king@canonical.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: David Howells <dhowells@redhat.com> Cc: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Sam Protsenko <semen.protsenko@linaro.org> Cc: Yann Droneaud <ydroneaud@opteya.com> Cc: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/coda/cnode.c')
-rw-r--r--fs/coda/cnode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c
index e2dcf2addf3f..06855f6c7902 100644
--- a/fs/coda/cnode.c
+++ b/fs/coda/cnode.c
@@ -148,6 +148,16 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
return inode;
}
+struct coda_file_info *coda_ftoc(struct file *file)
+{
+ struct coda_file_info *cfi = file->private_data;
+
+ BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
+
+ return cfi;
+
+}
+
/* the CONTROL inode is made without asking attributes from Venus */
struct inode *coda_cnode_makectl(struct super_block *sb)
{