diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-06-17 13:26:38 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-10 23:40:26 -0400 |
commit | c03b40246123b2ced79e2620d1d2c089bb12369a (patch) | |
tree | 59851fd137ee3ef4d7a3f6a5c6953011f45f8f96 /include/linux/nfs_page.h | |
parent | a50f7951a31d3b976e829250853f89c9d2da32c0 (diff) |
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.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index bd193af80162..c780e7e39f99 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/sunrpc/auth.h> | 16 | #include <linux/sunrpc/auth.h> |
17 | #include <linux/nfs_xdr.h> | 17 | #include <linux/nfs_xdr.h> |
18 | 18 | ||
19 | #include <asm/atomic.h> | 19 | #include <linux/kref.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * Valid flags for the radix tree | 22 | * Valid flags for the radix tree |
@@ -42,7 +42,7 @@ struct nfs_page { | |||
42 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ | 42 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ |
43 | wb_pgbase, /* Start of page data */ | 43 | wb_pgbase, /* Start of page data */ |
44 | wb_bytes; /* Length of request */ | 44 | wb_bytes; /* Length of request */ |
45 | atomic_t wb_count; /* reference count */ | 45 | struct kref wb_kref; /* reference count */ |
46 | unsigned long wb_flags; | 46 | unsigned long wb_flags; |
47 | struct nfs_writeverf wb_verf; /* Commit cookie */ | 47 | struct nfs_writeverf wb_verf; /* Commit cookie */ |
48 | }; | 48 | }; |
@@ -89,7 +89,7 @@ extern void nfs_clear_page_writeback(struct nfs_page *req); | |||
89 | 89 | ||
90 | 90 | ||
91 | /* | 91 | /* |
92 | * Lock the page of an asynchronous request without incrementing the wb_count | 92 | * Lock the page of an asynchronous request without getting a new reference |
93 | */ | 93 | */ |
94 | static inline int | 94 | static inline int |
95 | nfs_lock_request_dontget(struct nfs_page *req) | 95 | nfs_lock_request_dontget(struct nfs_page *req) |
@@ -98,14 +98,14 @@ nfs_lock_request_dontget(struct nfs_page *req) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | /* | 100 | /* |
101 | * Lock the page of an asynchronous request | 101 | * Lock the page of an asynchronous request and take a reference |
102 | */ | 102 | */ |
103 | static inline int | 103 | static inline int |
104 | nfs_lock_request(struct nfs_page *req) | 104 | nfs_lock_request(struct nfs_page *req) |
105 | { | 105 | { |
106 | if (test_and_set_bit(PG_BUSY, &req->wb_flags)) | 106 | if (test_and_set_bit(PG_BUSY, &req->wb_flags)) |
107 | return 0; | 107 | return 0; |
108 | atomic_inc(&req->wb_count); | 108 | kref_get(&req->wb_kref); |
109 | return 1; | 109 | return 1; |
110 | } | 110 | } |
111 | 111 | ||