diff options
author | Paulo Alcantara <palcantara@suse.de> | 2018-11-14 19:24:03 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-12-28 17:09:46 +0100 |
commit | 1c780228e9d47b966983a8bbf475dd45967bf0d5 (patch) | |
tree | 1ec77f5ef9f27d859d507b598f03c732576e1915 /fs/cifs/smb1ops.c | |
parent | cifs: minor updates to documentation (diff) | |
download | linux-1c780228e9d47b966983a8bbf475dd45967bf0d5.tar.xz linux-1c780228e9d47b966983a8bbf475dd45967bf0d5.zip |
cifs: Make use of DFS cache to get new DFS referrals
This patch will make use of DFS cache routines where appropriate and
do not always request a new referral from server.
Signed-off-by: Paulo Alcantara <palcantara@suse.de>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r-- | fs/cifs/smb1ops.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 378151e09e91..32a6c020478f 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c @@ -929,19 +929,18 @@ cifs_unix_dfs_readlink(const unsigned int xid, struct cifs_tcon *tcon, { #ifdef CONFIG_CIFS_DFS_UPCALL int rc; - unsigned int num_referrals = 0; - struct dfs_info3_param *referrals = NULL; + struct dfs_info3_param referral = {0}; - rc = get_dfs_path(xid, tcon->ses, searchName, nls_codepage, - &num_referrals, &referrals, 0); + rc = get_dfs_path(xid, tcon->ses, searchName, nls_codepage, &referral, + 0); - if (!rc && num_referrals > 0) { - *symlinkinfo = kstrndup(referrals->node_name, - strlen(referrals->node_name), + if (!rc) { + *symlinkinfo = kstrndup(referral.node_name, + strlen(referral.node_name), GFP_KERNEL); + free_dfs_info_param(&referral); if (!*symlinkinfo) rc = -ENOMEM; - free_dfs_info_array(referrals, num_referrals); } return rc; #else /* No DFS support */ |