summaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_page.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-17 13:26:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:26 -0400
commitc03b40246123b2ced79e2620d1d2c089bb12369a (patch)
tree59851fd137ee3ef4d7a3f6a5c6953011f45f8f96 /include/linux/nfs_page.h
parenta50f7951a31d3b976e829250853f89c9d2da32c0 (diff)
downloadop-kernel-dev-c03b40246123b2ced79e2620d1d2c089bb12369a.zip
op-kernel-dev-c03b40246123b2ced79e2620d1d2c089bb12369a.tar.gz
NFS: Convert struct nfs_page to use krefs
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/nfs_page.h')
-rw-r--r--include/linux/nfs_page.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index bd193af..c780e7e 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -16,7 +16,7 @@
#include <linux/sunrpc/auth.h>
#include <linux/nfs_xdr.h>
-#include <asm/atomic.h>
+#include <linux/kref.h>
/*
* Valid flags for the radix tree
@@ -42,7 +42,7 @@ struct nfs_page {
unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
wb_pgbase, /* Start of page data */
wb_bytes; /* Length of request */
- atomic_t wb_count; /* reference count */
+ struct kref wb_kref; /* reference count */
unsigned long wb_flags;
struct nfs_writeverf wb_verf; /* Commit cookie */
};
@@ -89,7 +89,7 @@ extern void nfs_clear_page_writeback(struct nfs_page *req);
/*
- * Lock the page of an asynchronous request without incrementing the wb_count
+ * Lock the page of an asynchronous request without getting a new reference
*/
static inline int
nfs_lock_request_dontget(struct nfs_page *req)
@@ -98,14 +98,14 @@ nfs_lock_request_dontget(struct nfs_page *req)
}
/*
- * Lock the page of an asynchronous request
+ * Lock the page of an asynchronous request and take a reference
*/
static inline int
nfs_lock_request(struct nfs_page *req)
{
if (test_and_set_bit(PG_BUSY, &req->wb_flags))
return 0;
- atomic_inc(&req->wb_count);
+ kref_get(&req->wb_kref);
return 1;
}
OpenPOWER on IntegriCloud