]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/cifs/inode.c
ARM: OMAP: Force APLLs always active
[linux-2.6-omap-h63xx.git] / fs / cifs / inode.c
index 1ad8c9fcc742394aedee8df91ddd9bc100c3d7ed..37c6ce87416b3eb540f05e30859e6b262c080dd8 100644 (file)
@@ -90,6 +90,9 @@ int cifs_get_inode_info_unix(struct inode **pinode,
                                (*pinode)->i_ino =
                                        (unsigned long)findData.UniqueId;
                        } /* note ino incremented to unique num in new_inode */
+                       if(sb->s_flags & MS_NOATIME)
+                               (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
+                               
                        insert_inode_hash(*pinode);
                }
 
@@ -140,7 +143,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
                inode->i_gid = le64_to_cpu(findData.Gid);
                inode->i_nlink = le64_to_cpu(findData.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 */
 
@@ -318,6 +321,7 @@ int cifs_get_inode_info(struct inode **pinode,
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
        char *tmp_path;
        char *buf = NULL;
+       int adjustTZ = FALSE;
 
        pTcon = cifs_sb->tcon;
        cFYI(1,("Getting info on %s", search_path));
@@ -348,6 +352,7 @@ int cifs_get_inode_info(struct inode **pinode,
                                        pfindData, cifs_sb->local_nls, 
                                        cifs_sb->mnt_cifs_flags &
                                          CIFS_MOUNT_MAP_SPECIAL_CHR);
+                       adjustTZ = TRUE;
                }
                
        }
@@ -419,6 +424,8 @@ int cifs_get_inode_info(struct inode **pinode,
                                } else /* do we need cast or hash to ino? */
                                        (*pinode)->i_ino = inode_num;
                        } /* else ino incremented to unique num in new_inode*/
+                       if(sb->s_flags & MS_NOATIME)
+                               (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
                        insert_inode_hash(*pinode);
                }
                inode = *pinode;
@@ -444,6 +451,10 @@ int cifs_get_inode_info(struct inode **pinode,
                inode->i_ctime =
                    cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
                cFYI(0, ("Attributes came in as 0x%x", attr));
+               if(adjustTZ && (pTcon->ses) && (pTcon->ses->server)) {
+                       inode->i_ctime.tv_sec += pTcon->ses->server->timeAdj;
+                       inode->i_mtime.tv_sec += pTcon->ses->server->timeAdj;
+               }
 
                /* set default mode. will override for dirs below */
                if (atomic_read(&cifsInfo->inUse) == 0)
@@ -485,8 +496,8 @@ int cifs_get_inode_info(struct inode **pinode,
                /* BB add code here -
                   validate if device or weird share or device type? */
                }
-               if (is_size_safe_to_change(cifsInfo)) {
-                       /* can not safely change the file size here if the
+               if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) {
+                       /* can not safely shrink the file size here if the
                           client is writing to it due to potential races */
                        i_size_write(inode,le64_to_cpu(pfindData->EndOfFile));
 
@@ -1353,7 +1364,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                and this check ensures that we are not being called from
                sys_utimes in which case we ought to fail the call back to
                the user when the server rejects the call */
-               if((rc) && (attrs->ia_valid &&
+               if((rc) && (attrs->ia_valid &
                         (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE)))
                        rc = 0;
        }