diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-06-15 21:47:56 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-06-15 21:52:47 -0400 |
commit | 9d2a3f31d6d7832cd441eeda08bc2266cdd5d972 (patch) | |
tree | c2089263f2d68ff9c5174ebea96ef0cbcb085682 /fs/nfsd | |
parent | 6aad89c8376e432231b78d1bdbcc10ef7708b011 (diff) |
nfsd: track last inode only in use_wgather case
Updating last_ino and last_dev probably isn't useful in the !use_wgather
case.
Also remove some pointless ifdef'd-out code.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/vfs.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index f30cc4eadb0a..ebf56c6040ca 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1026,7 +1026,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, | |||
1026 | if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) | 1026 | if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) |
1027 | kill_suid(dentry); | 1027 | kill_suid(dentry); |
1028 | 1028 | ||
1029 | if (host_err >= 0 && stable) { | 1029 | if (host_err >= 0 && stable && use_wgather) { |
1030 | static ino_t last_ino; | 1030 | static ino_t last_ino; |
1031 | static dev_t last_dev; | 1031 | static dev_t last_dev; |
1032 | 1032 | ||
@@ -1042,21 +1042,16 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, | |||
1042 | * nice and simple solution (IMHO), and it seems to | 1042 | * nice and simple solution (IMHO), and it seems to |
1043 | * work:-) | 1043 | * work:-) |
1044 | */ | 1044 | */ |
1045 | if (use_wgather) { | 1045 | if (atomic_read(&inode->i_writecount) > 1 |
1046 | if (atomic_read(&inode->i_writecount) > 1 | 1046 | || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) { |
1047 | || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) { | 1047 | dprintk("nfsd: write defer %d\n", task_pid_nr(current)); |
1048 | dprintk("nfsd: write defer %d\n", task_pid_nr(current)); | 1048 | msleep(10); |
1049 | msleep(10); | 1049 | dprintk("nfsd: write resume %d\n", task_pid_nr(current)); |
1050 | dprintk("nfsd: write resume %d\n", task_pid_nr(current)); | 1050 | } |
1051 | } | ||
1052 | 1051 | ||
1053 | if (inode->i_state & I_DIRTY) { | 1052 | if (inode->i_state & I_DIRTY) { |
1054 | dprintk("nfsd: write sync %d\n", task_pid_nr(current)); | 1053 | dprintk("nfsd: write sync %d\n", task_pid_nr(current)); |
1055 | host_err=nfsd_sync(file); | 1054 | host_err=nfsd_sync(file); |
1056 | } | ||
1057 | #if 0 | ||
1058 | wake_up(&inode->i_wait); | ||
1059 | #endif | ||
1060 | } | 1055 | } |
1061 | last_ino = inode->i_ino; | 1056 | last_ino = inode->i_ino; |
1062 | last_dev = inode->i_sb->s_dev; | 1057 | last_dev = inode->i_sb->s_dev; |