]> err.no Git - linux-2.6/blobdiff - fs/cifs/netmisc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6] / fs / cifs / netmisc.c
index 32efa32774d22a73e48dd6c1773322d6caaf0cb9..ce87550e918f8d33d87573677287e24d2da234e9 100644 (file)
@@ -72,6 +72,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
        {ERRinvlevel,-EOPNOTSUPP},
        {ERRdirnotempty, -ENOTEMPTY},
        {ERRnotlocked, -ENOLCK},
+       {ERRcancelviolation, -ENOLCK},
        {ERRalreadyexists, -EEXIST},
        {ERRmoredata, -EOVERFLOW},
        {ERReasnotsupported,-EOPNOTSUPP},
@@ -84,11 +85,11 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
 
 static const struct smb_to_posix_error mapping_table_ERRSRV[] = {
        {ERRerror, -EIO},
-       {ERRbadpw, -EPERM},
+       {ERRbadpw, -EACCES},  /* was EPERM */
        {ERRbadtype, -EREMOTE},
        {ERRaccess, -EACCES},
        {ERRinvtid, -ENXIO},
-       {ERRinvnetname, -ENODEV},
+       {ERRinvnetname, -ENXIO},
        {ERRinvdevice, -ENXIO},
        {ERRqfull, -ENOSPC},
        {ERRqtoobig, -ENOSPC},
@@ -330,7 +331,7 @@ static const struct {
        ERRHRD, ERRgeneral, NT_STATUS_ACCOUNT_RESTRICTION}, {
        ERRSRV, 2241, NT_STATUS_INVALID_LOGON_HOURS}, {
        ERRSRV, 2240, NT_STATUS_INVALID_WORKSTATION}, {
-       ERRSRV, 2242, NT_STATUS_PASSWORD_EXPIRED}, {
+       ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_EXPIRED}, {
        ERRSRV, 2239, NT_STATUS_ACCOUNT_DISABLED}, {
        ERRHRD, ERRgeneral, NT_STATUS_NONE_MAPPED}, {
        ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, {
@@ -676,7 +677,7 @@ static const struct {
        ERRDOS, 193, NT_STATUS_IMAGE_CHECKSUM_MISMATCH}, {
        ERRHRD, ERRgeneral, NT_STATUS_LOST_WRITEBEHIND_DATA}, {
        ERRHRD, ERRgeneral, NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID}, {
-       ERRSRV, 2242, NT_STATUS_PASSWORD_MUST_CHANGE}, {
+       ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_MUST_CHANGE}, {
        ERRHRD, ERRgeneral, NT_STATUS_NOT_FOUND}, {
        ERRHRD, ERRgeneral, NT_STATUS_NOT_TINY_STREAM}, {
        ERRHRD, ERRgeneral, NT_STATUS_RECOVERY_FAILURE}, {
@@ -813,7 +814,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 {
@@ -868,7 +869,14 @@ unsigned int
 smbCalcSize(struct smb_hdr *ptr)
 {
        return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
-               2 /* size of the bcc field itself */ + 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 */