Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cifs: Make extract_sharename function public

Move the function to misc.c

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Samuel Cabrero and committed by
Steve French
e73a42e0 a87e6725

+26 -25
-24
fs/cifs/cache.c
··· 53 53 .type = FSCACHE_COOKIE_TYPE_INDEX, 54 54 }; 55 55 56 - char *extract_sharename(const char *treename) 57 - { 58 - const char *src; 59 - char *delim, *dst; 60 - int len; 61 - 62 - /* skip double chars at the beginning */ 63 - src = treename + 2; 64 - 65 - /* share name is always preceded by '\\' now */ 66 - delim = strchr(src, '\\'); 67 - if (!delim) 68 - return ERR_PTR(-EINVAL); 69 - delim++; 70 - len = strlen(delim); 71 - 72 - /* caller has to free the memory */ 73 - dst = kstrndup(delim, len, GFP_KERNEL); 74 - if (!dst) 75 - return ERR_PTR(-ENOMEM); 76 - 77 - return dst; 78 - } 79 - 80 56 static enum 81 57 fscache_checkaux cifs_fscache_super_check_aux(void *cookie_netfs_data, 82 58 const void *data,
+1
fs/cifs/cifsproto.h
··· 618 618 void cifs_put_tcp_super(struct super_block *sb); 619 619 int update_super_prepath(struct cifs_tcon *tcon, char *prefix); 620 620 char *extract_hostname(const char *unc); 621 + char *extract_sharename(const char *unc); 621 622 622 623 #ifdef CONFIG_CIFS_DFS_UPCALL 623 624 static inline int get_dfs_path(const unsigned int xid, struct cifs_ses *ses,
+1
fs/cifs/fscache.c
··· 22 22 #include "cifsglob.h" 23 23 #include "cifs_debug.h" 24 24 #include "cifs_fs_sb.h" 25 + #include "cifsproto.h" 25 26 26 27 /* 27 28 * Key layout of CIFS server cache index object
-1
fs/cifs/fscache.h
··· 57 57 58 58 extern int cifs_fscache_register(void); 59 59 extern void cifs_fscache_unregister(void); 60 - extern char *extract_sharename(const char *); 61 60 62 61 /* 63 62 * fscache.c
+24
fs/cifs/misc.c
··· 1227 1227 1228 1228 return dst; 1229 1229 } 1230 + 1231 + char *extract_sharename(const char *unc) 1232 + { 1233 + const char *src; 1234 + char *delim, *dst; 1235 + int len; 1236 + 1237 + /* skip double chars at the beginning */ 1238 + src = unc + 2; 1239 + 1240 + /* share name is always preceded by '\\' now */ 1241 + delim = strchr(src, '\\'); 1242 + if (!delim) 1243 + return ERR_PTR(-EINVAL); 1244 + delim++; 1245 + len = strlen(delim); 1246 + 1247 + /* caller has to free the memory */ 1248 + dst = kstrndup(delim, len, GFP_KERNEL); 1249 + if (!dst) 1250 + return ERR_PTR(-ENOMEM); 1251 + 1252 + return dst; 1253 + }