patch-2.4.26 linux-2.4.26/fs/nfs/write.c
Next file: linux-2.4.26/fs/smbfs/proc.c
Previous file: linux-2.4.26/fs/nfs/read.c
Back to the patch index
Back to the overall index
- Lines: 162
- Date:
2004-04-14 06:05:40.000000000 -0700
- Orig file:
linux-2.4.25/fs/nfs/write.c
- Orig date:
2003-11-28 10:26:21.000000000 -0800
diff -urN linux-2.4.25/fs/nfs/write.c linux-2.4.26/fs/nfs/write.c
@@ -445,7 +445,7 @@
* Interruptible by signals only if mounted with intr flag.
*/
static int
-nfs_wait_on_requests(struct inode *inode, struct file *file, unsigned long idx_start, unsigned int npages)
+nfs_wait_on_requests(struct inode *inode, unsigned long idx_start, unsigned int npages)
{
struct list_head *p, *head;
unsigned long idx_end;
@@ -464,9 +464,6 @@
unsigned long pg_idx;
struct nfs_page *req = nfs_inode_wb_entry(p);
- if (file && req->wb_file != file)
- continue;
-
pg_idx = page_index(req->wb_page);
if (pg_idx < idx_start)
break;
@@ -538,7 +535,6 @@
* nfs_scan_dirty - Scan an inode for dirty requests
* @inode: NFS inode to scan
* @dst: destination list
- * @file: if set, ensure we match requests from this file
* @idx_start: lower bound of page->index to scan.
* @npages: idx_start + npages sets the upper bound to scan.
*
@@ -546,10 +542,10 @@
* The requests are *not* checked to ensure that they form a contiguous set.
*/
static int
-nfs_scan_dirty(struct inode *inode, struct list_head *dst, struct file *file, unsigned long idx_start, unsigned int npages)
+nfs_scan_dirty(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
{
int res;
- res = nfs_scan_list(&inode->u.nfs_i.dirty, dst, file, idx_start, npages);
+ res = nfs_scan_list(&inode->u.nfs_i.dirty, dst, idx_start, npages);
inode->u.nfs_i.ndirty -= res;
if ((inode->u.nfs_i.ndirty == 0) != list_empty(&inode->u.nfs_i.dirty))
printk(KERN_ERR "NFS: desynchronized value of nfs_i.ndirty.\n");
@@ -577,7 +573,7 @@
npages = nfs_scan_lru_timeout(&server->lru_commit, dst, 1);
if (npages) {
inode = nfs_list_entry(dst->next)->wb_inode;
- npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, NULL, 0, 0);
+ npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, 0, 0);
inode->u.nfs_i.ncommit -= npages;
}
return npages;
@@ -604,7 +600,7 @@
npages = nfs_scan_lru(&server->lru_commit, dst, 1);
if (npages) {
inode = nfs_list_entry(dst->next)->wb_inode;
- npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, NULL, 0, 0);
+ npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, 0, 0);
inode->u.nfs_i.ncommit -= npages;
}
return npages;
@@ -614,7 +610,6 @@
* nfs_scan_commit - Scan an inode for commit requests
* @inode: NFS inode to scan
* @dst: destination list
- * @file: if set, ensure we collect requests from this file only.
* @idx_start: lower bound of page->index to scan.
* @npages: idx_start + npages sets the upper bound to scan.
*
@@ -622,10 +617,10 @@
* The requests are *not* checked to ensure that they form a contiguous set.
*/
static int
-nfs_scan_commit(struct inode *inode, struct list_head *dst, struct file *file, unsigned long idx_start, unsigned int npages)
+nfs_scan_commit(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
{
int res;
- res = nfs_scan_list(&inode->u.nfs_i.commit, dst, file, idx_start, npages);
+ res = nfs_scan_list(&inode->u.nfs_i.commit, dst, idx_start, npages);
inode->u.nfs_i.ncommit -= res;
if ((inode->u.nfs_i.ncommit == 0) != list_empty(&inode->u.nfs_i.commit))
printk(KERN_ERR "NFS: desynchronized value of nfs_i.ncommit.\n");
@@ -753,12 +748,12 @@
#ifdef CONFIG_NFS_V3
if (NFS_PROTO(inode)->version == 2) {
if (dirty >= NFS_STRATEGY_PAGES * wpages)
- nfs_flush_file(inode, NULL, 0, 0, 0);
+ nfs_flush_file(inode, 0, 0, 0);
} else if (dirty >= wpages)
- nfs_flush_file(inode, NULL, 0, 0, 0);
+ nfs_flush_file(inode, 0, 0, 0);
#else
if (dirty >= NFS_STRATEGY_PAGES * wpages)
- nfs_flush_file(inode, NULL, 0, 0, 0);
+ nfs_flush_file(inode, 0, 0, 0);
#endif
}
@@ -1250,7 +1245,7 @@
}
#endif
-int nfs_flush_file(struct inode *inode, struct file *file, unsigned long idx_start,
+int nfs_flush_file(struct inode *inode, unsigned long idx_start,
unsigned int npages, int how)
{
LIST_HEAD(head);
@@ -1258,7 +1253,7 @@
error = 0;
spin_lock(&nfs_wreq_lock);
- res = nfs_scan_dirty(inode, &head, file, idx_start, npages);
+ res = nfs_scan_dirty(inode, &head, idx_start, npages);
spin_unlock(&nfs_wreq_lock);
if (res)
error = nfs_flush_list(&head, NFS_SERVER(inode)->wpages, how);
@@ -1268,15 +1263,14 @@
}
#ifdef CONFIG_NFS_V3
-int nfs_commit_file(struct inode *inode, struct file *file, unsigned long idx_start,
- unsigned int npages, int how)
+int nfs_commit_file(struct inode *inode, int how)
{
LIST_HEAD(head);
int res,
error = 0;
spin_lock(&nfs_wreq_lock);
- res = nfs_scan_commit(inode, &head, file, idx_start, npages);
+ res = nfs_scan_commit(inode, &head, 0, 0);
spin_unlock(&nfs_wreq_lock);
if (res)
error = nfs_commit_list(&head, how);
@@ -1286,7 +1280,7 @@
}
#endif
-int nfs_sync_file(struct inode *inode, struct file *file, unsigned long idx_start,
+int nfs_sync_file(struct inode *inode, unsigned long idx_start,
unsigned int npages, int how)
{
int error,
@@ -1295,18 +1289,15 @@
wait = how & FLUSH_WAIT;
how &= ~FLUSH_WAIT;
- if (!inode && file)
- inode = file->f_dentry->d_inode;
-
do {
error = 0;
if (wait)
- error = nfs_wait_on_requests(inode, file, idx_start, npages);
+ error = nfs_wait_on_requests(inode, idx_start, npages);
if (error == 0)
- error = nfs_flush_file(inode, file, idx_start, npages, how);
+ error = nfs_flush_file(inode, idx_start, npages, how);
#ifdef CONFIG_NFS_V3
if (error == 0)
- error = nfs_commit_file(inode, file, idx_start, npages, how);
+ error = nfs_commit_file(inode, how);
#endif
} while (error > 0);
return error;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)