diff options
author | Paulo Alcantara <pc@manguebit.com> | 2023-08-17 18:34:07 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-08-21 00:05:50 +0300 |
commit | 9a49e221a64111535f65e9c8804db24d11eaff8b (patch) | |
tree | b4c28e1ea18d25f1276f5fb0d7be7a1a423e75fb /fs/smb/client/inode.c | |
parent | 5f71ebc412944908c9780cca5acc9170385b6e77 (diff) | |
download | linux-9a49e221a64111535f65e9c8804db24d11eaff8b.tar.xz |
smb: client: do not query reparse points twice on symlinks
Save a roundtrip by getting the reparse point tag and buffer at once
in ->query_reparse_point() and then pass the buffer down to
->query_symlink().
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/inode.c')
-rw-r--r-- | fs/smb/client/inode.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index 51e2916730cf..96a09818aa5b 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -428,7 +428,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, if (!server->ops->query_symlink) return -EOPNOTSUPP; rc = server->ops->query_symlink(xid, tcon, cifs_sb, full_path, - &fattr.cf_symlink_target, false); + &fattr.cf_symlink_target, NULL); if (rc) { cifs_dbg(FYI, "%s: query_symlink: %d\n", __func__, rc); goto cgiiu_exit; @@ -988,17 +988,21 @@ static int query_reparse(struct cifs_open_info_data *data, { struct TCP_Server_Info *server = tcon->ses->server; struct cifs_sb_info *cifs_sb = CIFS_SB(sb); - bool reparse_point = data->reparse_point; + struct kvec rsp_iov, *iov = NULL; + int rsp_buftype = CIFS_NO_BUFFER; u32 tag = data->reparse_tag; int rc = 0; - if (!tag && server->ops->query_reparse_tag) { - server->ops->query_reparse_tag(xid, tcon, cifs_sb, - full_path, &tag); + if (!tag && server->ops->query_reparse_point) { + rc = server->ops->query_reparse_point(xid, tcon, cifs_sb, + full_path, &tag, + &rsp_iov, &rsp_buftype); + if (!rc) + iov = &rsp_iov; } switch ((data->reparse_tag = tag)) { case 0: /* SMB1 symlink */ - reparse_point = false; + iov = NULL; fallthrough; case IO_REPARSE_TAG_NFS: case IO_REPARSE_TAG_SYMLINK: @@ -1006,10 +1010,11 @@ static int query_reparse(struct cifs_open_info_data *data, rc = server->ops->query_symlink(xid, tcon, cifs_sb, full_path, &data->symlink_target, - reparse_point); + iov); } break; } + free_rsp_buf(rsp_buftype, rsp_iov.iov_base); return rc; } |