]> Pileus Git - ~andy/linux/blobdiff - fs/cifs/misc.c
[PATCH] s390: fadvise hint values.
[~andy/linux] / fs / cifs / misc.c
index 6d7bb427e4fae5a3222bb0ef4ce955a86d28d488..072b4ee8c53e1a28c51002d8a331c497a0b8c05c 100644 (file)
@@ -452,25 +452,30 @@ is_valid_oplock_break(struct smb_hdr *buf)
                        atomic_inc(&tcon->num_oplock_brks);
 #endif
                        list_for_each(tmp1,&tcon->openFileList){
-                               netfile = list_entry(tmp1,struct cifsFileInfo,tlist);
+                               netfile = list_entry(tmp1,struct cifsFileInfo,
+                                                    tlist);
                                if(pSMB->Fid == netfile->netfid) {
                                        struct cifsInodeInfo *pCifsInode;
                                        read_unlock(&GlobalSMBSeslock);
-                                       cFYI(1,("Matching file id, processing oplock break"));
+                                       cFYI(1,("file id match, oplock break"));
                                        pCifsInode = 
                                                CIFS_I(netfile->pInode);
                                        pCifsInode->clientCanCacheAll = FALSE;
                                        if(pSMB->OplockLevel == 0)
-                                               pCifsInode->clientCanCacheRead = FALSE;
+                                               pCifsInode->clientCanCacheRead
+                                                       = FALSE;
                                        pCifsInode->oplockPending = TRUE;
-                                       AllocOplockQEntry(netfile->pInode, netfile->netfid, tcon);
+                                       AllocOplockQEntry(netfile->pInode,
+                                                         netfile->netfid,
+                                                         tcon);
                                        cFYI(1,("about to wake up oplock thd"));
-                                       wake_up_process(oplockThread);               
+                                       if(oplockThread)
+                                           wake_up_process(oplockThread);
                                        return TRUE;
                                }
                        }
                        read_unlock(&GlobalSMBSeslock);
-                       cFYI(1,("No matching file for oplock break on connection"));
+                       cFYI(1,("No matching file for oplock break"));
                        return TRUE;
                }
        }
@@ -491,7 +496,7 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
 
        buffer = (unsigned char *) smb_buf;
        for (i = 0, j = 0; i < smb_buf_length; i++, j++) {
-               if (i % 8 == 0) {       /* we have reached the beginning of line  */
+               if (i % 8 == 0) {       /* have reached the beginning of line */
                        printk(KERN_DEBUG "| ");
                        j = 0;
                }
@@ -502,7 +507,7 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
                else
                        debug_line[1 + (2 * j)] = '_';
 
-               if (i % 8 == 7) {       /* we have reached end of line, time to print ascii */
+               if (i % 8 == 7) { /* reached end of line, time to print ascii */
                        debug_line[16] = 0;
                        printk(" | %s\n", debug_line);
                }
@@ -519,13 +524,13 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
 /* Windows maps these to the user defined 16 bit Unicode range since they are
    reserved symbols (along with \ and /), otherwise illegal to store
    in filenames in NTFS */
-#define UNI_ASTERIK     cpu_to_le16('*' + 0xF000)
-#define UNI_QUESTION    cpu_to_le16('?' + 0xF000)
-#define UNI_COLON       cpu_to_le16(':' + 0xF000)
-#define UNI_GRTRTHAN    cpu_to_le16('>' + 0xF000)
-#define UNI_LESSTHAN    cpu_to_le16('<' + 0xF000)
-#define UNI_PIPE        cpu_to_le16('|' + 0xF000)
-#define UNI_SLASH       cpu_to_le16('\\' + 0xF000)
+#define UNI_ASTERIK     (__u16) ('*' + 0xF000)
+#define UNI_QUESTION    (__u16) ('?' + 0xF000)
+#define UNI_COLON       (__u16) (':' + 0xF000)
+#define UNI_GRTRTHAN    (__u16) ('>' + 0xF000)
+#define UNI_LESSTHAN    (__u16) ('<' + 0xF000)
+#define UNI_PIPE        (__u16) ('|' + 0xF000)
+#define UNI_SLASH       (__u16) ('\\' + 0xF000)
 
 /* Convert 16 bit Unicode pathname from wire format to string in current code
    page.  Conversion may involve remapping up the seven characters that are
@@ -536,7 +541,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen,
                    const struct nls_table * cp)
 {
        int i,j,len;
-       wchar_t src_char;
+       __u16 src_char;
 
        for(i = 0, j = 0; i < maxlen; i++) {
                src_char = le16_to_cpu(source[i]);
@@ -566,6 +571,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen,
                                break;
                        case UNI_LESSTHAN:
                                target[j] = '<';
+                               break;
                        default: 
                                len = cp->uni2char(src_char, &target[j], 
                                                NLS_MAX_CHARSET_SIZE);
@@ -577,7 +583,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen,
                                }
                }
                j++;
-               /* check to make sure we do not overrun callers allocated temp buffer */
+               /* make sure we do not overrun callers allocated temp buffer */
                if(j >= (2 * NAME_MAX))
                        break;
        }
@@ -599,7 +605,7 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen,
        char src_char;
 
        if(!mapChars) 
-               return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp); 
+               return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp);
 
        for(i = 0, j = 0; i < maxlen; j++) {
                src_char = source[i];