diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsfs.c | 11 | ||||
-rw-r--r-- | fs/cifs/cifspdu.h | 8 | ||||
-rw-r--r-- | fs/cifs/file.c | 5 | ||||
-rw-r--r-- | fs/cifs/inode.c | 7 | ||||
-rw-r--r-- | fs/cifs/link.c | 3 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 4 |
6 files changed, 28 insertions, 10 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index e8287c4c6eb3..bc2c0ac27169 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 | } |
@@ -283,6 +287,7 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) | |||
283 | 287 | ||
284 | if (cifs_sb) { | 288 | if (cifs_sb) { |
285 | if (cifs_sb->tcon) { | 289 | if (cifs_sb->tcon) { |
290 | /* BB add prepath to mount options displayed */ | ||
286 | seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); | 291 | seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); |
287 | if (cifs_sb->tcon->ses) { | 292 | if (cifs_sb->tcon->ses) { |
288 | if (cifs_sb->tcon->ses->userName) | 293 | if (cifs_sb->tcon->ses->userName) |
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index 7d9505491b16..2498d644827c 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
@@ -35,9 +35,11 @@ | |||
35 | #define BAD_PROT 0xFFFF | 35 | #define BAD_PROT 0xFFFF |
36 | 36 | ||
37 | /* SMB command codes */ | 37 | /* SMB command codes */ |
38 | /* Some commands have minimal (wct=0,bcc=0), or uninteresting, responses | 38 | /* |
39 | (ie which include no useful data other than the SMB error code itself). | 39 | * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses |
40 | Knowing this helps avoid response buffer allocations and copy in some cases */ | 40 | * (ie which include no useful data other than the SMB error code itself). |
41 | * Knowing this helps avoid response buffer allocations and copy in some cases | ||
42 | */ | ||
41 | #define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */ | 43 | #define SMB_COM_CREATE_DIRECTORY 0x00 /* trivial response */ |
42 | #define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */ | 44 | #define SMB_COM_DELETE_DIRECTORY 0x01 /* trivial response */ |
43 | #define SMB_COM_CLOSE 0x04 /* triv req/rsp, timestamp ignored */ | 45 | #define SMB_COM_CLOSE 0x04 /* triv req/rsp, timestamp ignored */ |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 07ff9351e9ee..a1265c9bfec0 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1014,8 +1014,9 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
1014 | /* since the write may have blocked check these pointers again */ | 1014 | /* since the write may have blocked check these pointers again */ |
1015 | if (file->f_path.dentry) { | 1015 | if (file->f_path.dentry) { |
1016 | if (file->f_path.dentry->d_inode) { | 1016 | if (file->f_path.dentry->d_inode) { |
1017 | file->f_path.dentry->d_inode->i_ctime = | 1017 | /*BB We could make this contingent on superblock ATIME flag too */ |
1018 | file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME; | 1018 | /* file->f_path.dentry->d_inode->i_ctime = |
1019 | file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;*/ | ||
1019 | if (total_written > 0) { | 1020 | if (total_written > 0) { |
1020 | if (*poffset > file->f_path.dentry->d_inode->i_size) | 1021 | if (*poffset > file->f_path.dentry->d_inode->i_size) |
1021 | i_size_write(file->f_path.dentry->d_inode, | 1022 | i_size_write(file->f_path.dentry->d_inode, |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 3f5bc83dc3d1..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; |
@@ -1359,7 +1364,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1359 | and this check ensures that we are not being called from | 1364 | and this check ensures that we are not being called from |
1360 | sys_utimes in which case we ought to fail the call back to | 1365 | sys_utimes in which case we ought to fail the call back to |
1361 | the user when the server rejects the call */ | 1366 | the user when the server rejects the call */ |
1362 | if((rc) && (attrs->ia_valid && | 1367 | if((rc) && (attrs->ia_valid & |
1363 | (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE))) | 1368 | (ATTR_MODE | ATTR_GID | ATTR_UID | ATTR_SIZE))) |
1364 | rc = 0; | 1369 | rc = 0; |
1365 | } | 1370 | } |
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 | ||