]> err.no Git - linux-2.6/blobdiff - fs/cifs/readdir.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / fs / cifs / readdir.c
index f519e1910191317401872a32b6e676ba872052de..0f22def4bdff47e30300dec9bcad5be12cd193d6 100644 (file)
@@ -51,7 +51,6 @@ static void dump_cifs_file_struct(struct file *file, char *label)
                if (cf->srch_inf.emptyDir) {
                        cFYI(1, ("empty dir"));
                }
-               
        }
 }
 #endif /* DEBUG2 */
@@ -122,7 +121,7 @@ static void AdjustForTZ(struct cifsTconInfo *tcon, struct inode *inode)
 
 
 static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
-                         char *buf, int *pobject_type, int isNewInode)
+                         char *buf, unsigned int *pobject_type, int isNewInode)
 {
        loff_t local_size;
        struct timespec local_mtime;
@@ -172,7 +171,13 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
        /* Linux can not store file creation time unfortunately so ignore it */
 
        cifsInfo->cifsAttrs = attr;
-       cifsInfo->time = jiffies;
+#ifdef CONFIG_CIFS_EXPERIMENTAL
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
+               /* get more accurate mode via ACL - so force inode refresh */
+               cifsInfo->time = 0;
+       } else
+#endif /* CONFIG_CIFS_EXPERIMENTAL */
+               cifsInfo->time = jiffies;
 
        /* treat dos attribute of read-only as read-only mode bit e.g. 555? */
        /* 2767 perms - indicate mandatory locking */
@@ -255,7 +260,6 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
                                tmp_inode->i_fop = &cifs_file_direct_nobrl_ops;
                        else
                                tmp_inode->i_fop = &cifs_file_direct_ops;
-               
                } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
                        tmp_inode->i_fop = &cifs_file_nobrl_ops;
                else
@@ -296,7 +300,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
 }
 
 static void unix_fill_in_inode(struct inode *tmp_inode,
-       FILE_UNIX_INFO *pfindData, int *pobject_type, int isNewInode)
+       FILE_UNIX_INFO *pfindData, unsigned int *pobject_type, int isNewInode)
 {
        loff_t local_size;
        struct timespec local_mtime;
@@ -465,7 +469,9 @@ static int initiate_cifs_search(const int xid, struct file *file)
 
 ffirst_retry:
        /* test for Unix extensions */
-       if (pTcon->ses->capabilities & CAP_UNIX) {
+       /* but now check for them on the share/mount not on the SMB session */
+/*     if (pTcon->ses->capabilities & CAP_UNIX) { */
+       if (pTcon->unix_ext) {
                cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX;
        } else if ((pTcon->ses->capabilities &
                        (CAP_NT_SMBS | CAP_NT_FIND)) == 0) {
@@ -495,7 +501,7 @@ ffirst_retry:
 static int cifs_unicode_bytelen(char *str)
 {
        int len;
-       __le16 * ustr = (__le16 *)str;
+       __le16 *ustr = (__le16 *)str;
 
        for (len = 0; len <= PATH_MAX; len++) {
                if (ustr[len] == 0)
@@ -644,11 +650,11 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
        loff_t index_to_find = file->f_pos;
        struct cifsFileInfo *cifsFile = file->private_data;
        /* check if index in the buffer */
-       
+
        if ((cifsFile == NULL) || (ppCurrentEntry == NULL) ||
           (num_to_ret == NULL))
                return -ENOENT;
-       
+
        *ppCurrentEntry = NULL;
        first_entry_in_buffer =
                cifsFile->srch_inf.index_of_last_entry -
@@ -712,7 +718,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
                pos_in_buf = index_to_find - first_entry_in_buffer;
                cFYI(1, ("found entry - pos_in_buf %d", pos_in_buf));
 
-               for (i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) {
+               for (i=0; (i < (pos_in_buf)) && (current_entry != NULL); i++) {
                        /* go entry by entry figuring out which is first */
                        current_entry = nxt_dir_entry(current_entry, end_of_smb,
                                                cifsFile->srch_inf.info_level);
@@ -826,7 +832,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
        int rc = 0;
        struct qstr qstring;
        struct cifsFileInfo *pCifsF;
-       unsigned obj_type;
+       unsigned int obj_type;
        ino_t  inum;
        struct cifs_sb_info *cifs_sb;
        struct inode *tmp_inode;
@@ -839,7 +845,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
                return -EINVAL;
 
        pCifsF = file->private_data;
-       
+
        if ((scratch_buf == NULL) || (pfindEntry == NULL) || (pCifsF == NULL))
                return -ENOENT;
 
@@ -892,7 +898,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
                if (rc == 2)
                        d_rehash(tmp_dentry);
        }
-       
+
 
        rc = filldir(direntry, qstring.name, qstring.len, file->f_pos,
                     tmp_inode->i_ino, obj_type);
@@ -951,7 +957,7 @@ static int cifs_save_resume_key(const char *current_entry,
                len = le32_to_cpu(pFindData->FileNameLength);
                cifsFile->srch_inf.resume_key = pFindData->FileIndex;
        } else if (level == SMB_FIND_FILE_BOTH_DIRECTORY_INFO) {
-               FILE_BOTH_DIRECTORY_INFO *pFindData = 
+               FILE_BOTH_DIRECTORY_INFO *pFindData =
                        (FILE_BOTH_DIRECTORY_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                len = le32_to_cpu(pFindData->FileNameLength);
@@ -982,7 +988,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
        char *current_entry;
        int num_to_fill = 0;
        char *tmp_buf = NULL;
-       char * end_of_smb;
+       char *end_of_smb;
        int max_len;
 
        xid = GetXid();
@@ -1067,7 +1073,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
                for (i = 0; (i < num_to_fill) && (rc == 0); i++) {
                        if (current_entry == NULL) {
                                /* evaluate whether this case is an error */
-                               cERROR(1,("past end of SMB num to fill %d i %d",
+                               cERROR(1, ("past SMB end,  num to fill %d i %d",
                                          num_to_fill, i));
                                break;
                        }