diff options
author | Fred Isaman <iisaman@netapp.com> | 2011-02-28 20:34:13 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:38:42 -0500 |
commit | d684d2ae10a4f95d3035abf698d7d611ff2cd279 (patch) | |
tree | 9bae2d1808b8e2a0d153d8d1d13f0d9a01408de0 /fs/nfs/pnfs.h | |
parent | 94de8b27d0dcb2608d56a7e5c2941b87e6da7ce3 (diff) |
NFSv4.1: lseg refcounting
Prepare put_lseg and get_lseg to be called from the pNFS I/O code.
Pull common code from pnfs_lseg_locked to call from pnfs_lseg.
Inline pnfs_lseg_locked into it's only caller.
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r-- | fs/nfs/pnfs.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index e2612ea0cbed..9a994bc9899f 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -177,6 +177,16 @@ static inline int lo_fail_bit(u32 iomode) | |||
177 | NFS_LAYOUT_RW_FAILED : NFS_LAYOUT_RO_FAILED; | 177 | NFS_LAYOUT_RW_FAILED : NFS_LAYOUT_RO_FAILED; |
178 | } | 178 | } |
179 | 179 | ||
180 | static inline struct pnfs_layout_segment * | ||
181 | get_lseg(struct pnfs_layout_segment *lseg) | ||
182 | { | ||
183 | if (lseg) { | ||
184 | atomic_inc(&lseg->pls_refcount); | ||
185 | smp_mb__after_atomic_inc(); | ||
186 | } | ||
187 | return lseg; | ||
188 | } | ||
189 | |||
180 | /* Return true if a layout driver is being used for this mountpoint */ | 190 | /* Return true if a layout driver is being used for this mountpoint */ |
181 | static inline int pnfs_enabled_sb(struct nfs_server *nfss) | 191 | static inline int pnfs_enabled_sb(struct nfs_server *nfss) |
182 | { | 192 | { |
@@ -194,6 +204,16 @@ static inline void pnfs_destroy_layout(struct nfs_inode *nfsi) | |||
194 | } | 204 | } |
195 | 205 | ||
196 | static inline struct pnfs_layout_segment * | 206 | static inline struct pnfs_layout_segment * |
207 | get_lseg(struct pnfs_layout_segment *lseg) | ||
208 | { | ||
209 | return NULL; | ||
210 | } | ||
211 | |||
212 | static inline void put_lseg(struct pnfs_layout_segment *lseg) | ||
213 | { | ||
214 | } | ||
215 | |||
216 | static inline struct pnfs_layout_segment * | ||
197 | pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, | 217 | pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, |
198 | enum pnfs_iomode access_type) | 218 | enum pnfs_iomode access_type) |
199 | { | 219 | { |