Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
[sfrench/cifs-2.6.git] / fs / cifs / readdir.c
index 782940be550f48b59077e944d5306df27c33036b..c444798f0740f91da21052def00e2a9852c383a8 100644 (file)
@@ -83,6 +83,8 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
                                return rc;
                        rc = 1;
                }
+               if(file->f_path.dentry->d_sb->s_flags & MS_NOATIME)
+                       (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME;
        } else {
                tmp_dentry = d_alloc(file->f_path.dentry, qstring);
                if(tmp_dentry == NULL) {
@@ -98,6 +100,8 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
                        tmp_dentry->d_op = &cifs_dentry_ops;
                if(*ptmp_inode == NULL)
                        return rc;
+               if(file->f_path.dentry->d_sb->s_flags & MS_NOATIME)
+                       (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME;                       
                rc = 2;
        }
 
@@ -222,7 +226,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
                atomic_set(&cifsInfo->inUse, 1);
        }
 
-       if (is_size_safe_to_change(cifsInfo)) {
+       if (is_size_safe_to_change(cifsInfo, end_of_file)) {
                /* can not safely change the file size here if the 
                client is writing to it due to potential races */
                i_size_write(tmp_inode, end_of_file);
@@ -351,10 +355,10 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
        tmp_inode->i_gid = le64_to_cpu(pfindData->Gid);
        tmp_inode->i_nlink = le64_to_cpu(pfindData->Nlinks);
 
-       if (is_size_safe_to_change(cifsInfo)) {
+       if (is_size_safe_to_change(cifsInfo, end_of_file)) {
                /* can not safely change the file size here if the 
                client is writing to it due to potential races */
-               i_size_write(tmp_inode,end_of_file);
+               i_size_write(tmp_inode, end_of_file);
 
        /* 512 bytes (2**9) is the fake blocksize that must be used */
        /* for this calculation, not the real blocksize */