aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-03 17:33:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-03 17:33:09 -0400
commit54161df1fb1469d66bce3a3b14d8281adbb69263 (patch)
treeb5f0f8741db382daf09dd236e9e678d60422dc48 /fs/cifs/netmisc.c
parentbe82ae0238b0453afcf4a76f0512b7dde34ba500 (diff)
parentcb76d5e25008b76fb8e348c861d32659430ac3fa (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (29 commits) cifs: fsc should not default to "on" [CIFS] remove redundant path walking in dfs_do_refmount cifs: ignore the "mand", "nomand" and "_netdev" mount options cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS cifs: don't allow cifs_iget to match inodes of the wrong type [CIFS] relinquish fscache cookie before freeing CIFSTconInfo cifs: add separate cred_uid field to sesInfo fs: cifs: check kmalloc() result [CIFS] Missing ifdef [CIFS] Missing line from previous commit [CIFS] Fix build break when CONFIG_CIFS_FSCACHE disabled cifs: add mount option to enable local caching cifs: read pages from FS-Cache cifs: store pages into local cache cifs: FS-Cache page management cifs: define inode-level cache object and register them cifs: define superblock-level cache index objects and register them cifs: remove unused cifsUidInfo struct cifs: clean up cifs_find_smb_ses (try #2) cifs: match secType when searching for existing tcp session ...
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r--fs/cifs/netmisc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index d35d52889cb5..c6721ee26dbc 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -61,6 +61,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
61 {ERRremcd, -EACCES}, 61 {ERRremcd, -EACCES},
62 {ERRdiffdevice, -EXDEV}, 62 {ERRdiffdevice, -EXDEV},
63 {ERRnofiles, -ENOENT}, 63 {ERRnofiles, -ENOENT},
64 {ERRwriteprot, -EROFS},
64 {ERRbadshare, -ETXTBSY}, 65 {ERRbadshare, -ETXTBSY},
65 {ERRlock, -EACCES}, 66 {ERRlock, -EACCES},
66 {ERRunsup, -EINVAL}, 67 {ERRunsup, -EINVAL},
@@ -164,7 +165,7 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
164 * Returns 0 on failure. 165 * Returns 0 on failure.
165 */ 166 */
166int 167int
167cifs_convert_address(char *src, void *dst) 168cifs_convert_address(struct sockaddr *dst, char *src)
168{ 169{
169 int rc; 170 int rc;
170 char *pct, *endp; 171 char *pct, *endp;
@@ -201,6 +202,27 @@ cifs_convert_address(char *src, void *dst)
201 return rc; 202 return rc;
202} 203}
203 204
205int
206cifs_fill_sockaddr(struct sockaddr *dst, char *src,
207 const unsigned short int port)
208{
209 if (!cifs_convert_address(dst, src))
210 return 0;
211
212 switch (dst->sa_family) {
213 case AF_INET:
214 ((struct sockaddr_in *)dst)->sin_port = htons(port);
215 break;
216 case AF_INET6:
217 ((struct sockaddr_in6 *)dst)->sin6_port = htons(port);
218 break;
219 default:
220 return 0;
221 }
222
223 return 1;
224}
225
204/***************************************************************************** 226/*****************************************************************************
205convert a NT status code to a dos class/code 227convert a NT status code to a dos class/code
206 *****************************************************************************/ 228 *****************************************************************************/