]> err.no Git - linux-2.6/blobdiff - fs/cifs/netmisc.c
Merge branch 'master'
[linux-2.6] / fs / cifs / netmisc.c
index dfaabc8d8fb6ad8caedc34c5a30f4eec3555a0cc..f7814689844b2f4440b374024f92d7899349b29b 100644 (file)
@@ -78,6 +78,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
        {ErrQuota, -EDQUOT},
        {ErrNotALink, -ENOLINK},
        {ERRnetlogonNotStarted,-ENOPROTOOPT},
+       {ErrTooManyLinks,-EMLINK},
        {0, 0}
 };
 
@@ -132,7 +133,6 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = {
 int
 cifs_inet_pton(int address_family, char *cp,void *dst)
 {
-       struct in_addr address;
        int value;
        int digit;
        int i;
@@ -189,8 +189,7 @@ cifs_inet_pton(int address_family, char *cp,void *dst)
        if (value > addr_class_max[end - bytes])
                return 0;
 
-       address.s_addr = *((__be32 *) bytes) | htonl(value);
-       *((__be32 *)dst) = address.s_addr;
+       *((__be32 *)dst) = *((__be32 *) bytes) | htonl(value);
        return 1; /* success */
 }
 
@@ -742,7 +741,7 @@ static const struct {
        ERRDOS, 182, NT_STATUS_DRIVER_ORDINAL_NOT_FOUND}, {
        ERRDOS, 127, NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND}, {
        ERRDOS, 288, NT_STATUS_RESOURCE_NOT_OWNED}, {
-       ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LINKS}, {
+       ERRDOS, ErrTooManyLinks, NT_STATUS_TOO_MANY_LINKS}, {
        ERRHRD, ERRgeneral, NT_STATUS_QUOTA_LIST_INCONSISTENT}, {
        ERRHRD, ERRgeneral, NT_STATUS_FILE_IS_OFFLINE}, {
        ERRDOS, 21, 0xc000026e}, {
@@ -814,7 +813,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
        if (smb->Flags2 & SMBFLG2_ERR_STATUS) {
                /* translate the newer STATUS codes to old style errors and then to POSIX errors */
                __u32 err = le32_to_cpu(smb->Status.CifsError);
-               if(cifsFYI)
+               if(cifsFYI & CIFS_RC)
                        cifs_print_status(err);
                ntstatus_to_dos(err, &smberrclass, &smberrcode);
        } else {
@@ -869,7 +868,14 @@ unsigned int
 smbCalcSize(struct smb_hdr *ptr)
 {
        return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
-               BCC(ptr));
+               2 /* size of the bcc field */ + BCC(ptr));
+}
+
+unsigned int
+smbCalcSize_LE(struct smb_hdr *ptr)
+{
+       return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
+               2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr)));
 }
 
 /* The following are taken from fs/ntfs/util.c */