diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2020-11-11 17:22:32 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2020-11-11 17:22:32 +0100 |
commit | bd3bf1e85bac1bd956365a0036a6817c3ffe20fb (patch) | |
tree | f370b669716e2898c381d7b19c63b16e0bebe09b /fs/fuse/fuse_i.h | |
parent | fuse: get rid of fuse_mount refcount (diff) | |
download | linux-bd3bf1e85bac1bd956365a0036a6817c3ffe20fb.tar.xz linux-bd3bf1e85bac1bd956365a0036a6817c3ffe20fb.zip |
fuse: simplify get_fuse_conn*()
All callers dereference the result, so no point in checking for NULL
pointer dereference here.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 919aaf184676..8301c5056022 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -818,9 +818,7 @@ static inline struct fuse_mount *get_fuse_mount_super(struct super_block *sb) static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb) { - struct fuse_mount *fm = get_fuse_mount_super(sb); - - return fm ? fm->fc : NULL; + return get_fuse_mount_super(sb)->fc; } static inline struct fuse_mount *get_fuse_mount(struct inode *inode) @@ -830,9 +828,7 @@ static inline struct fuse_mount *get_fuse_mount(struct inode *inode) static inline struct fuse_conn *get_fuse_conn(struct inode *inode) { - struct fuse_mount *fm = get_fuse_mount(inode); - - return fm ? fm->fc : NULL; + return get_fuse_mount_super(inode->i_sb)->fc; } static inline struct fuse_inode *get_fuse_inode(struct inode *inode) |