diff options
author | Hyunchul Lee <hyc.lee@gmail.com> | 2021-07-03 12:10:36 +0900 |
---|---|---|
committer | Namjae Jeon <namjae.jeon@samsung.com> | 2021-07-05 09:22:49 +0900 |
commit | 465d720485eff1468503d210b1b966660f5f9b85 (patch) | |
tree | a1580b00e3295e9b6b29253dbc9e50e84ed9af38 /fs/ksmbd/smb_common.c | |
parent | 690f969705138b235b9fa4c4d19e5129ed54a845 (diff) |
ksmbd: call mnt_user_ns once in a function
Avoid calling mnt_user_ns() many time in
a function.
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Christian Brauner <christian@brauner.io>
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/smb_common.c')
-rw-r--r-- | fs/ksmbd/smb_common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ksmbd/smb_common.c b/fs/ksmbd/smb_common.c index f770f3ffb840..38026d9bb704 100644 --- a/fs/ksmbd/smb_common.c +++ b/fs/ksmbd/smb_common.c @@ -279,6 +279,7 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, { int i, rc = 0; struct ksmbd_conn *conn = work->conn; + struct user_namespace *user_ns = file_mnt_user_ns(dir->filp); for (i = 0; i < 2; i++) { struct kstat kstat; @@ -301,11 +302,11 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, ksmbd_kstat.kstat = &kstat; ksmbd_vfs_fill_dentry_attrs(work, - file_mnt_user_ns(dir->filp), + user_ns, dir->filp->f_path.dentry->d_parent, &ksmbd_kstat); rc = fn(conn, info_level, d_info, - file_mnt_user_ns(dir->filp), &ksmbd_kstat); + user_ns, &ksmbd_kstat); if (rc) break; if (d_info->out_buf_len <= 0) |