Loading fs/cifs/cifs_dfs_ref.c +8 −6 Original line number Diff line number Diff line Loading @@ -3,8 +3,9 @@ * traversal via DFS junction point * * Copyright (c) 2007 Igor Mammedov * Copyright (C) International Business Machines Corp., 2008 * Author(s): Igor Mammedov (niallain@gmail.com) * * Steve French (sfrench@us.ibm.com) * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version Loading Loading @@ -107,7 +108,8 @@ static char *cifs_get_share_name(const char *node_name) * Returns: pointer to new mount options or ERR_PTR. * Caller is responcible for freeing retunrned value if it is not error. */ char *compose_mount_options(const char *sb_mountdata, const char *ref_unc, static char *compose_mount_options(const char *sb_mountdata, const char *ref_unc, char **devname) { int rc; Loading Loading @@ -188,13 +190,13 @@ char *compose_mount_options(const char *sb_mountdata, const char *ref_unc, } struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, struct dentry *dentry, char *ref_unc) { struct cifs_sb_info *cifs_sb; struct vfsmount *mnt; char *mountdata; char *devname; char *devname = NULL; cifs_sb = CIFS_SB(dentry->d_inode->i_sb); mountdata = compose_mount_options(cifs_sb->mountdata, Loading Loading @@ -278,7 +280,7 @@ static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd, return err; } void dump_referral(const struct dfs_info3_param *ref) static void dump_referral(const struct dfs_info3_param *ref) { cFYI(1, ("DFS: ref path: %s", ref->path_name)); cFYI(1, ("DFS: node path: %s", ref->node_name)); Loading fs/cifs/cifsglob.h +32 −9 Original line number Diff line number Diff line /* * fs/cifs/cifsglob.h * * Copyright (C) International Business Machines Corp., 2002,2007 * Copyright (C) International Business Machines Corp., 2002,2008 * Author(s): Steve French (sfrench@us.ibm.com) * Jeremy Allison (jra@samba.org) * Loading Loading @@ -69,14 +69,6 @@ #define XATTR_DOS_ATTRIB "user.DOSATTRIB" #endif /* * This information is kept on every Server we know about. * * Some things to note: * */ #define SERVER_NAME_LEN_WITH_NULL (SERVER_NAME_LENGTH + 1) /* * CIFS vfs client Status information (based on what we know.) */ Loading Loading @@ -460,6 +452,37 @@ struct dir_notify_req { struct file *pfile; }; struct dfs_info3_param { int flags; /* DFSREF_REFERRAL_SERVER, DFSREF_STORAGE_SERVER*/ int PathConsumed; int server_type; int ref_flag; char *path_name; char *node_name; }; static inline void free_dfs_info_param(struct dfs_info3_param *param) { if (param) { kfree(param->path_name); kfree(param->node_name); kfree(param); } } static inline void free_dfs_info_array(struct dfs_info3_param *param, int number_of_items) { int i; if ((number_of_items == 0) || (param == NULL)) return; for (i = 0; i < number_of_items; i++) { kfree(param[i].path_name); kfree(param[i].node_name); } kfree(param); } #define MID_FREE 0 #define MID_REQUEST_ALLOCATED 1 #define MID_REQUEST_SUBMITTED 2 Loading fs/cifs/cifsproto.h +2 −2 Original line number Diff line number Diff line /* * fs/cifs/cifsproto.h * * Copyright (c) International Business Machines Corp., 2002,2007 * Copyright (c) International Business Machines Corp., 2002,2008 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify Loading Loading @@ -156,7 +156,7 @@ extern int get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, unsigned int *pnum_referrals, unsigned char **preferrals, struct dfs_info3_param **preferrals, int remap); extern void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon, struct super_block *sb, struct smb_vol *vol); Loading fs/cifs/connect.c +8 −4 Original line number Diff line number Diff line /* * fs/cifs/connect.c * * Copyright (C) International Business Machines Corp., 2002,2007 * Copyright (C) International Business Machines Corp., 2002,2008 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify Loading Loading @@ -1410,7 +1410,7 @@ connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, int remap) { unsigned char *referrals = NULL; struct dfs_info3_param *referrals = NULL; unsigned int num_referrals; int rc = 0; Loading @@ -1429,12 +1429,14 @@ connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, int get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, unsigned int *pnum_referrals, unsigned char **preferrals, int remap) struct dfs_info3_param **preferrals, int remap) { char *temp_unc; int rc = 0; unsigned char *targetUNCs; *pnum_referrals = 0; *preferrals = NULL; if (pSesInfo->ipc_tid == 0) { temp_unc = kmalloc(2 /* for slashes */ + Loading @@ -1454,8 +1456,10 @@ get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, kfree(temp_unc); } if (rc == 0) rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, preferrals, rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, &targetUNCs, pnum_referrals, nls_codepage, remap); /* BB map targetUNCs to dfs_info3 structures, here or in CIFSGetDFSRefer BB */ return rc; } Loading fs/cifs/dns_resolve.c +3 −2 Original line number Diff line number Diff line Loading @@ -64,13 +64,14 @@ struct key_type key_type_dns_resolver = { * return 0 on success */ int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) { dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) { int rc = -EAGAIN; struct key *rkey; char *name; int len; if ((!ip_addr) || (!unc)) if (!ip_addr || !unc) return -EINVAL; /* search for server name delimiter */ Loading Loading
fs/cifs/cifs_dfs_ref.c +8 −6 Original line number Diff line number Diff line Loading @@ -3,8 +3,9 @@ * traversal via DFS junction point * * Copyright (c) 2007 Igor Mammedov * Copyright (C) International Business Machines Corp., 2008 * Author(s): Igor Mammedov (niallain@gmail.com) * * Steve French (sfrench@us.ibm.com) * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version Loading Loading @@ -107,7 +108,8 @@ static char *cifs_get_share_name(const char *node_name) * Returns: pointer to new mount options or ERR_PTR. * Caller is responcible for freeing retunrned value if it is not error. */ char *compose_mount_options(const char *sb_mountdata, const char *ref_unc, static char *compose_mount_options(const char *sb_mountdata, const char *ref_unc, char **devname) { int rc; Loading Loading @@ -188,13 +190,13 @@ char *compose_mount_options(const char *sb_mountdata, const char *ref_unc, } struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, struct dentry *dentry, char *ref_unc) { struct cifs_sb_info *cifs_sb; struct vfsmount *mnt; char *mountdata; char *devname; char *devname = NULL; cifs_sb = CIFS_SB(dentry->d_inode->i_sb); mountdata = compose_mount_options(cifs_sb->mountdata, Loading Loading @@ -278,7 +280,7 @@ static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd, return err; } void dump_referral(const struct dfs_info3_param *ref) static void dump_referral(const struct dfs_info3_param *ref) { cFYI(1, ("DFS: ref path: %s", ref->path_name)); cFYI(1, ("DFS: node path: %s", ref->node_name)); Loading
fs/cifs/cifsglob.h +32 −9 Original line number Diff line number Diff line /* * fs/cifs/cifsglob.h * * Copyright (C) International Business Machines Corp., 2002,2007 * Copyright (C) International Business Machines Corp., 2002,2008 * Author(s): Steve French (sfrench@us.ibm.com) * Jeremy Allison (jra@samba.org) * Loading Loading @@ -69,14 +69,6 @@ #define XATTR_DOS_ATTRIB "user.DOSATTRIB" #endif /* * This information is kept on every Server we know about. * * Some things to note: * */ #define SERVER_NAME_LEN_WITH_NULL (SERVER_NAME_LENGTH + 1) /* * CIFS vfs client Status information (based on what we know.) */ Loading Loading @@ -460,6 +452,37 @@ struct dir_notify_req { struct file *pfile; }; struct dfs_info3_param { int flags; /* DFSREF_REFERRAL_SERVER, DFSREF_STORAGE_SERVER*/ int PathConsumed; int server_type; int ref_flag; char *path_name; char *node_name; }; static inline void free_dfs_info_param(struct dfs_info3_param *param) { if (param) { kfree(param->path_name); kfree(param->node_name); kfree(param); } } static inline void free_dfs_info_array(struct dfs_info3_param *param, int number_of_items) { int i; if ((number_of_items == 0) || (param == NULL)) return; for (i = 0; i < number_of_items; i++) { kfree(param[i].path_name); kfree(param[i].node_name); } kfree(param); } #define MID_FREE 0 #define MID_REQUEST_ALLOCATED 1 #define MID_REQUEST_SUBMITTED 2 Loading
fs/cifs/cifsproto.h +2 −2 Original line number Diff line number Diff line /* * fs/cifs/cifsproto.h * * Copyright (c) International Business Machines Corp., 2002,2007 * Copyright (c) International Business Machines Corp., 2002,2008 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify Loading Loading @@ -156,7 +156,7 @@ extern int get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, unsigned int *pnum_referrals, unsigned char **preferrals, struct dfs_info3_param **preferrals, int remap); extern void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon, struct super_block *sb, struct smb_vol *vol); Loading
fs/cifs/connect.c +8 −4 Original line number Diff line number Diff line /* * fs/cifs/connect.c * * Copyright (C) International Business Machines Corp., 2002,2007 * Copyright (C) International Business Machines Corp., 2002,2008 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify Loading Loading @@ -1410,7 +1410,7 @@ connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, int remap) { unsigned char *referrals = NULL; struct dfs_info3_param *referrals = NULL; unsigned int num_referrals; int rc = 0; Loading @@ -1429,12 +1429,14 @@ connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, int get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, const struct nls_table *nls_codepage, unsigned int *pnum_referrals, unsigned char **preferrals, int remap) struct dfs_info3_param **preferrals, int remap) { char *temp_unc; int rc = 0; unsigned char *targetUNCs; *pnum_referrals = 0; *preferrals = NULL; if (pSesInfo->ipc_tid == 0) { temp_unc = kmalloc(2 /* for slashes */ + Loading @@ -1454,8 +1456,10 @@ get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, kfree(temp_unc); } if (rc == 0) rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, preferrals, rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, &targetUNCs, pnum_referrals, nls_codepage, remap); /* BB map targetUNCs to dfs_info3 structures, here or in CIFSGetDFSRefer BB */ return rc; } Loading
fs/cifs/dns_resolve.c +3 −2 Original line number Diff line number Diff line Loading @@ -64,13 +64,14 @@ struct key_type key_type_dns_resolver = { * return 0 on success */ int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) { dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) { int rc = -EAGAIN; struct key *rkey; char *name; int len; if ((!ip_addr) || (!unc)) if (!ip_addr || !unc) return -EINVAL; /* search for server name delimiter */ Loading