diff options
author | Steve French <sfrench@us.ibm.com> | 2007-02-16 23:30:54 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-02-16 23:30:54 -0500 |
commit | 1b2b212603ceb47d60aff571dcfffc846fcfa336 (patch) | |
tree | a46aa9356cf8142b5f78520bdfc8efba8ecdbe1b | |
parent | c14e894bd40868d6d1f2379705b68acf5288ba27 (diff) |
[CIFS] mtime bounces from local to remote when cifs nocmtime i_flags overwritten
atime flag was also overwritten. Noticed by Shirish when he was debugging
an atime problem. Should help performance a bit too.
cifs should be getting time stamps from the server (that was the original
intent too)
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/cifsfs.c | 10 | ||||
-rw-r--r-- | fs/cifs/inode.c | 5 | ||||
-rw-r--r-- | fs/cifs/link.c | 3 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 4 |
4 files changed, 18 insertions, 4 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index e8287c4c6eb3..887c89b43bd8 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -91,8 +91,9 @@ cifs_read_super(struct super_block *sb, void *data, | |||
91 | struct inode *inode; | 91 | struct inode *inode; |
92 | struct cifs_sb_info *cifs_sb; | 92 | struct cifs_sb_info *cifs_sb; |
93 | int rc = 0; | 93 | int rc = 0; |
94 | 94 | ||
95 | sb->s_flags |= MS_NODIRATIME; /* and probably even noatime */ | 95 | /* BB should we make this contingent on mount parm? */ |
96 | sb->s_flags |= MS_NODIRATIME | MS_NOATIME; | ||
96 | sb->s_fs_info = kzalloc(sizeof(struct cifs_sb_info),GFP_KERNEL); | 97 | sb->s_fs_info = kzalloc(sizeof(struct cifs_sb_info),GFP_KERNEL); |
97 | cifs_sb = CIFS_SB(sb); | 98 | cifs_sb = CIFS_SB(sb); |
98 | if(cifs_sb == NULL) | 99 | if(cifs_sb == NULL) |
@@ -258,7 +259,10 @@ cifs_alloc_inode(struct super_block *sb) | |||
258 | cifs_inode->clientCanCacheRead = FALSE; | 259 | cifs_inode->clientCanCacheRead = FALSE; |
259 | cifs_inode->clientCanCacheAll = FALSE; | 260 | cifs_inode->clientCanCacheAll = FALSE; |
260 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ | 261 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ |
261 | cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME; | 262 | |
263 | /* Can not set i_flags here - they get immediately overwritten | ||
264 | to zero by the VFS */ | ||
265 | /* cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME;*/ | ||
262 | INIT_LIST_HEAD(&cifs_inode->openFileList); | 266 | INIT_LIST_HEAD(&cifs_inode->openFileList); |
263 | return &cifs_inode->vfs_inode; | 267 | return &cifs_inode->vfs_inode; |
264 | } | 268 | } |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index e203f63c66d5..37c6ce87416b 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -90,6 +90,9 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
90 | (*pinode)->i_ino = | 90 | (*pinode)->i_ino = |
91 | (unsigned long)findData.UniqueId; | 91 | (unsigned long)findData.UniqueId; |
92 | } /* note ino incremented to unique num in new_inode */ | 92 | } /* note ino incremented to unique num in new_inode */ |
93 | if(sb->s_flags & MS_NOATIME) | ||
94 | (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME; | ||
95 | |||
93 | insert_inode_hash(*pinode); | 96 | insert_inode_hash(*pinode); |
94 | } | 97 | } |
95 | 98 | ||
@@ -421,6 +424,8 @@ int cifs_get_inode_info(struct inode **pinode, | |||
421 | } else /* do we need cast or hash to ino? */ | 424 | } else /* do we need cast or hash to ino? */ |
422 | (*pinode)->i_ino = inode_num; | 425 | (*pinode)->i_ino = inode_num; |
423 | } /* else ino incremented to unique num in new_inode*/ | 426 | } /* else ino incremented to unique num in new_inode*/ |
427 | if(sb->s_flags & MS_NOATIME) | ||
428 | (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME; | ||
424 | insert_inode_hash(*pinode); | 429 | insert_inode_hash(*pinode); |
425 | } | 430 | } |
426 | inode = *pinode; | 431 | inode = *pinode; |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 8e259969354b..6baea85d726e 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -77,7 +77,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, | |||
77 | cifsInode = CIFS_I(old_file->d_inode); | 77 | cifsInode = CIFS_I(old_file->d_inode); |
78 | if(rc == 0) { | 78 | if(rc == 0) { |
79 | old_file->d_inode->i_nlink++; | 79 | old_file->d_inode->i_nlink++; |
80 | old_file->d_inode->i_ctime = CURRENT_TIME; | 80 | /* BB should we make this contingent on superblock flag NOATIME? */ |
81 | /* old_file->d_inode->i_ctime = CURRENT_TIME;*/ | ||
81 | /* parent dir timestamps will update from srv | 82 | /* parent dir timestamps will update from srv |
82 | within a second, would it really be worth it | 83 | within a second, would it really be worth it |
83 | to set the parent dir cifs inode time to zero | 84 | to set the parent dir cifs inode time to zero |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index c6220bd27165..c444798f0740 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -83,6 +83,8 @@ static int construct_dentry(struct qstr *qstring, struct file *file, | |||
83 | return rc; | 83 | return rc; |
84 | rc = 1; | 84 | rc = 1; |
85 | } | 85 | } |
86 | if(file->f_path.dentry->d_sb->s_flags & MS_NOATIME) | ||
87 | (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME; | ||
86 | } else { | 88 | } else { |
87 | tmp_dentry = d_alloc(file->f_path.dentry, qstring); | 89 | tmp_dentry = d_alloc(file->f_path.dentry, qstring); |
88 | if(tmp_dentry == NULL) { | 90 | if(tmp_dentry == NULL) { |
@@ -98,6 +100,8 @@ static int construct_dentry(struct qstr *qstring, struct file *file, | |||
98 | tmp_dentry->d_op = &cifs_dentry_ops; | 100 | tmp_dentry->d_op = &cifs_dentry_ops; |
99 | if(*ptmp_inode == NULL) | 101 | if(*ptmp_inode == NULL) |
100 | return rc; | 102 | return rc; |
103 | if(file->f_path.dentry->d_sb->s_flags & MS_NOATIME) | ||
104 | (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME; | ||
101 | rc = 2; | 105 | rc = 2; |
102 | } | 106 | } |
103 | 107 | ||