Commit 944b2a7c authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] A basic NFSv4 client for 2.5.x

In a number of places in the NFS client, I had to change

  #ifdef CONFIG_NFS_V3
     /* ... */
  #endif

to

  #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
     /* ... */
  #endif
parent 4e956d0f
...@@ -171,7 +171,7 @@ nfs_flushd(struct rpc_task *task) ...@@ -171,7 +171,7 @@ nfs_flushd(struct rpc_task *task)
nfs_pagein_list(&head, server->rpages); nfs_pagein_list(&head, server->rpages);
continue; continue;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (nfs_scan_lru_commit_timeout(server, &head)) { if (nfs_scan_lru_commit_timeout(server, &head)) {
spin_unlock(&nfs_wreq_lock); spin_unlock(&nfs_wreq_lock);
nfs_commit_list(&head, FLUSH_AGING); nfs_commit_list(&head, FLUSH_AGING);
......
...@@ -507,7 +507,7 @@ nfs_try_to_free_pages(struct nfs_server *server) ...@@ -507,7 +507,7 @@ nfs_try_to_free_pages(struct nfs_server *server)
continue; continue;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
/* Let's try to free up some completed NFSv3 unstable writes */ /* Let's try to free up some completed NFSv3 unstable writes */
nfs_scan_lru_commit(server, &head); nfs_scan_lru_commit(server, &head);
if (!list_empty(&head)) { if (!list_empty(&head)) {
......
...@@ -88,7 +88,7 @@ static struct nfs_page * nfs_update_request(struct file*, struct inode *, ...@@ -88,7 +88,7 @@ static struct nfs_page * nfs_update_request(struct file*, struct inode *,
unsigned int, unsigned int); unsigned int, unsigned int);
static void nfs_strategy(struct inode *inode); static void nfs_strategy(struct inode *inode);
static void nfs_writeback_done(struct rpc_task *); static void nfs_writeback_done(struct rpc_task *);
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
static void nfs_commit_done(struct rpc_task *); static void nfs_commit_done(struct rpc_task *);
#endif #endif
...@@ -414,7 +414,7 @@ nfs_dirty_request(struct nfs_page *req) ...@@ -414,7 +414,7 @@ nfs_dirty_request(struct nfs_page *req)
return !list_empty(&req->wb_list) && req->wb_list_head == &nfsi->dirty; return !list_empty(&req->wb_list) && req->wb_list_head == &nfsi->dirty;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
/* /*
* Add a request to the inode's commit list. * Add a request to the inode's commit list.
*/ */
...@@ -552,7 +552,7 @@ nfs_scan_dirty(struct inode *inode, struct list_head *dst, struct file *file, un ...@@ -552,7 +552,7 @@ nfs_scan_dirty(struct inode *inode, struct list_head *dst, struct file *file, un
return res; return res;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
/** /**
* nfs_scan_lru_commit_timeout - Scan LRU list for timed out commit requests * nfs_scan_lru_commit_timeout - Scan LRU list for timed out commit requests
* @server: NFS superblock data * @server: NFS superblock data
...@@ -747,7 +747,7 @@ nfs_strategy(struct inode *inode) ...@@ -747,7 +747,7 @@ nfs_strategy(struct inode *inode)
dirty = NFS_I(inode)->ndirty; dirty = NFS_I(inode)->ndirty;
wpages = NFS_SERVER(inode)->wpages; wpages = NFS_SERVER(inode)->wpages;
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (NFS_PROTO(inode)->version == 2) { if (NFS_PROTO(inode)->version == 2) {
if (dirty >= NFS_STRATEGY_PAGES * wpages) if (dirty >= NFS_STRATEGY_PAGES * wpages)
nfs_flush_file(inode, NULL, 0, 0, 0); nfs_flush_file(inode, NULL, 0, 0, 0);
...@@ -1032,7 +1032,7 @@ nfs_writeback_done(struct rpc_task *task) ...@@ -1032,7 +1032,7 @@ nfs_writeback_done(struct rpc_task *task)
* an error. */ * an error. */
task->tk_status = -EIO; task->tk_status = -EIO;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (resp->verf->committed < argp->stable && task->tk_status >= 0) { if (resp->verf->committed < argp->stable && task->tk_status >= 0) {
/* We tried a write call, but the server did not /* We tried a write call, but the server did not
* commit data to stable storage even though we * commit data to stable storage even though we
...@@ -1082,7 +1082,7 @@ nfs_writeback_done(struct rpc_task *task) ...@@ -1082,7 +1082,7 @@ nfs_writeback_done(struct rpc_task *task)
goto next; goto next;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (argp->stable != NFS_UNSTABLE || resp->verf->committed == NFS_FILE_SYNC) { if (argp->stable != NFS_UNSTABLE || resp->verf->committed == NFS_FILE_SYNC) {
nfs_inode_remove_request(req); nfs_inode_remove_request(req);
dprintk(" OK\n"); dprintk(" OK\n");
...@@ -1101,7 +1101,7 @@ nfs_writeback_done(struct rpc_task *task) ...@@ -1101,7 +1101,7 @@ nfs_writeback_done(struct rpc_task *task)
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
/* /*
* Set up the argument/result storage required for the RPC call. * Set up the argument/result storage required for the RPC call.
*/ */
...@@ -1265,7 +1265,7 @@ int nfs_flush_file(struct inode *inode, struct file *file, unsigned long idx_sta ...@@ -1265,7 +1265,7 @@ int nfs_flush_file(struct inode *inode, struct file *file, unsigned long idx_sta
return res; return res;
} }
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
int nfs_commit_file(struct inode *inode, struct file *file, unsigned long idx_start, int nfs_commit_file(struct inode *inode, struct file *file, unsigned long idx_start,
unsigned int npages, int how) unsigned int npages, int how)
{ {
...@@ -1302,7 +1302,7 @@ int nfs_sync_file(struct inode *inode, struct file *file, unsigned long idx_star ...@@ -1302,7 +1302,7 @@ int nfs_sync_file(struct inode *inode, struct file *file, unsigned long idx_star
error = nfs_wait_on_requests(inode, file, idx_start, npages); error = nfs_wait_on_requests(inode, file, idx_start, npages);
if (error == 0) if (error == 0)
error = nfs_flush_file(inode, file, idx_start, npages, how); error = nfs_flush_file(inode, file, idx_start, npages, how);
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (error == 0) if (error == 0)
error = nfs_commit_file(inode, file, idx_start, npages, how); error = nfs_commit_file(inode, file, idx_start, npages, how);
#endif #endif
......
...@@ -330,7 +330,7 @@ extern int nfs_flush_file(struct inode *, struct file *, unsigned long, unsigne ...@@ -330,7 +330,7 @@ extern int nfs_flush_file(struct inode *, struct file *, unsigned long, unsigne
extern int nfs_flush_list(struct list_head *, int, int); extern int nfs_flush_list(struct list_head *, int, int);
extern int nfs_scan_lru_dirty(struct nfs_server *, struct list_head *); extern int nfs_scan_lru_dirty(struct nfs_server *, struct list_head *);
extern int nfs_scan_lru_dirty_timeout(struct nfs_server *, struct list_head *); extern int nfs_scan_lru_dirty_timeout(struct nfs_server *, struct list_head *);
#ifdef CONFIG_NFS_V3 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
extern int nfs_commit_file(struct inode *, struct file *, unsigned long, unsigned int, int); extern int nfs_commit_file(struct inode *, struct file *, unsigned long, unsigned int, int);
extern int nfs_commit_list(struct list_head *, int); extern int nfs_commit_list(struct list_head *, int);
extern int nfs_scan_lru_commit(struct nfs_server *, struct list_head *); extern int nfs_scan_lru_commit(struct nfs_server *, struct list_head *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment