aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-06-25 11:57:32 -0400
committerSteve French <sfrench@us.ibm.com>2006-06-25 11:57:32 -0400
commitbbe5d235ee201705530a7153b57e141cd77d818b (patch)
treee98c31b4cb2ced6357a87a02596f9ecdbd6dbb26 /fs/cifs/file.c
parent189acaaef81b1d71aedd0d28810de24160c2e781 (diff)
parentdfd8317d3340f03bc06eba6b58f0ec0861da4a13 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index fafdcdffba62..616b140534be 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1084,9 +1084,9 @@ static int cifs_writepages(struct address_space *mapping,
1084 unsigned int bytes_written; 1084 unsigned int bytes_written;
1085 struct cifs_sb_info *cifs_sb; 1085 struct cifs_sb_info *cifs_sb;
1086 int done = 0; 1086 int done = 0;
1087 pgoff_t end = -1; 1087 pgoff_t end;
1088 pgoff_t index; 1088 pgoff_t index;
1089 int is_range = 0; 1089 int range_whole = 0;
1090 struct kvec iov[32]; 1090 struct kvec iov[32];
1091 int len; 1091 int len;
1092 int n_iov = 0; 1092 int n_iov = 0;
@@ -1127,16 +1127,14 @@ static int cifs_writepages(struct address_space *mapping,
1127 xid = GetXid(); 1127 xid = GetXid();
1128 1128
1129 pagevec_init(&pvec, 0); 1129 pagevec_init(&pvec, 0);
1130 if (wbc->sync_mode == WB_SYNC_NONE) 1130 if (wbc->range_cyclic) {
1131 index = mapping->writeback_index; /* Start from prev offset */ 1131 index = mapping->writeback_index; /* Start from prev offset */
1132 else { 1132 end = -1;
1133 index = 0; 1133 } else {
1134 scanned = 1; 1134 index = wbc->range_start >> PAGE_CACHE_SHIFT;
1135 } 1135 end = wbc->range_end >> PAGE_CACHE_SHIFT;
1136 if (wbc->start || wbc->end) { 1136 if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
1137 index = wbc->start >> PAGE_CACHE_SHIFT; 1137 range_whole = 1;
1138 end = wbc->end >> PAGE_CACHE_SHIFT;
1139 is_range = 1;
1140 scanned = 1; 1138 scanned = 1;
1141 } 1139 }
1142retry: 1140retry:
@@ -1172,7 +1170,7 @@ retry:
1172 break; 1170 break;
1173 } 1171 }
1174 1172
1175 if (unlikely(is_range) && (page->index > end)) { 1173 if (!wbc->range_cyclic && page->index > end) {
1176 done = 1; 1174 done = 1;
1177 unlock_page(page); 1175 unlock_page(page);
1178 break; 1176 break;
@@ -1276,7 +1274,7 @@ retry:
1276 index = 0; 1274 index = 0;
1277 goto retry; 1275 goto retry;
1278 } 1276 }
1279 if (!is_range) 1277 if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
1280 mapping->writeback_index = index; 1278 mapping->writeback_index = index;
1281 1279
1282 FreeXid(xid); 1280 FreeXid(xid);
@@ -1424,7 +1422,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
1424 * As file closes, flush all cached write data for this inode checking 1422 * As file closes, flush all cached write data for this inode checking
1425 * for write behind errors. 1423 * for write behind errors.
1426 */ 1424 */
1427int cifs_flush(struct file *file) 1425int cifs_flush(struct file *file, fl_owner_t id)
1428{ 1426{
1429 struct inode * inode = file->f_dentry->d_inode; 1427 struct inode * inode = file->f_dentry->d_inode;
1430 int rc = 0; 1428 int rc = 0;