diff options
author | Steve French <sfrench@us.ibm.com> | 2006-06-25 11:57:32 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-06-25 11:57:32 -0400 |
commit | bbe5d235ee201705530a7153b57e141cd77d818b (patch) | |
tree | e98c31b4cb2ced6357a87a02596f9ecdbd6dbb26 /fs/cifs | |
parent | 189acaaef81b1d71aedd0d28810de24160c2e781 (diff) | |
parent | dfd8317d3340f03bc06eba6b58f0ec0861da4a13 (diff) |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 13 | ||||
-rw-r--r-- | fs/cifs/cifsfs.h | 2 | ||||
-rw-r--r-- | fs/cifs/file.c | 26 |
3 files changed, 20 insertions, 21 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index fb7c11c2c913..f2e285457bee 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -166,8 +166,9 @@ cifs_put_super(struct super_block *sb) | |||
166 | } | 166 | } |
167 | 167 | ||
168 | static int | 168 | static int |
169 | cifs_statfs(struct super_block *sb, struct kstatfs *buf) | 169 | cifs_statfs(struct dentry *dentry, struct kstatfs *buf) |
170 | { | 170 | { |
171 | struct super_block *sb = dentry->d_sb; | ||
171 | int xid; | 172 | int xid; |
172 | int rc = -EOPNOTSUPP; | 173 | int rc = -EOPNOTSUPP; |
173 | struct cifs_sb_info *cifs_sb; | 174 | struct cifs_sb_info *cifs_sb; |
@@ -460,9 +461,9 @@ struct super_operations cifs_super_ops = { | |||
460 | .remount_fs = cifs_remount, | 461 | .remount_fs = cifs_remount, |
461 | }; | 462 | }; |
462 | 463 | ||
463 | static struct super_block * | 464 | static int |
464 | cifs_get_sb(struct file_system_type *fs_type, | 465 | cifs_get_sb(struct file_system_type *fs_type, |
465 | int flags, const char *dev_name, void *data) | 466 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) |
466 | { | 467 | { |
467 | int rc; | 468 | int rc; |
468 | struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL); | 469 | struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL); |
@@ -470,7 +471,7 @@ cifs_get_sb(struct file_system_type *fs_type, | |||
470 | cFYI(1, ("Devname: %s flags: %d ", dev_name, flags)); | 471 | cFYI(1, ("Devname: %s flags: %d ", dev_name, flags)); |
471 | 472 | ||
472 | if (IS_ERR(sb)) | 473 | if (IS_ERR(sb)) |
473 | return sb; | 474 | return PTR_ERR(sb); |
474 | 475 | ||
475 | sb->s_flags = flags; | 476 | sb->s_flags = flags; |
476 | 477 | ||
@@ -478,10 +479,10 @@ cifs_get_sb(struct file_system_type *fs_type, | |||
478 | if (rc) { | 479 | if (rc) { |
479 | up_write(&sb->s_umount); | 480 | up_write(&sb->s_umount); |
480 | deactivate_super(sb); | 481 | deactivate_super(sb); |
481 | return ERR_PTR(rc); | 482 | return rc; |
482 | } | 483 | } |
483 | sb->s_flags |= MS_ACTIVE; | 484 | sb->s_flags |= MS_ACTIVE; |
484 | return sb; | 485 | return simple_set_mnt(mnt, sb); |
485 | } | 486 | } |
486 | 487 | ||
487 | static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov, | 488 | static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov, |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 3011df988bd5..a6384d83fdef 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -75,7 +75,7 @@ extern ssize_t cifs_user_write(struct file *file, const char __user *write_data, | |||
75 | size_t write_size, loff_t * poffset); | 75 | size_t write_size, loff_t * poffset); |
76 | extern int cifs_lock(struct file *, int, struct file_lock *); | 76 | extern int cifs_lock(struct file *, int, struct file_lock *); |
77 | extern int cifs_fsync(struct file *, struct dentry *, int); | 77 | extern int cifs_fsync(struct file *, struct dentry *, int); |
78 | extern int cifs_flush(struct file *); | 78 | extern int cifs_flush(struct file *, fl_owner_t id); |
79 | extern int cifs_file_mmap(struct file * , struct vm_area_struct *); | 79 | extern int cifs_file_mmap(struct file * , struct vm_area_struct *); |
80 | extern const struct file_operations cifs_dir_ops; | 80 | extern const struct file_operations cifs_dir_ops; |
81 | extern int cifs_dir_open(struct inode *inode, struct file *file); | 81 | extern int cifs_dir_open(struct inode *inode, struct file *file); |
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 | } |
1142 | retry: | 1140 | retry: |
@@ -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 | */ |
1427 | int cifs_flush(struct file *file) | 1425 | int 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; |