diff options
| author | Benny Halevy <bhalevy@panasas.com> | 2008-01-23 01:59:08 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-30 02:06:11 -0500 |
| commit | 99fadcd76465842c014c88b8c9c19b457e9debc0 (patch) | |
| tree | 34b61c6444beacc58bc643285441a553af420dc4 /include/linux | |
| parent | 3a10c30acc4821ca000b52ed0edafd0d3bf26a52 (diff) | |
nfs: convert NFS_*(inode) helpers to static inline
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nfs_fs.h | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 9e7c24a2aca9..099ddb4481c0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -196,27 +196,67 @@ struct nfs_inode { | |||
| 196 | #define NFS_INO_STALE (2) /* possible stale inode */ | 196 | #define NFS_INO_STALE (2) /* possible stale inode */ |
| 197 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ | 197 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ |
| 198 | 198 | ||
| 199 | static inline struct nfs_inode *NFS_I(struct inode *inode) | 199 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
| 200 | { | 200 | { |
| 201 | return container_of(inode, struct nfs_inode, vfs_inode); | 201 | return container_of(inode, struct nfs_inode, vfs_inode); |
| 202 | } | 202 | } |
| 203 | #define NFS_SB(s) ((struct nfs_server *)(s->s_fs_info)) | 203 | |
| 204 | 204 | static inline struct nfs_server *NFS_SB(const struct super_block *s) | |
| 205 | #define NFS_FH(inode) (&NFS_I(inode)->fh) | 205 | { |
| 206 | #define NFS_SERVER(inode) (NFS_SB(inode->i_sb)) | 206 | return (struct nfs_server *)(s->s_fs_info); |
| 207 | #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) | 207 | } |
| 208 | #define NFS_PROTO(inode) (NFS_SERVER(inode)->nfs_client->rpc_ops) | 208 | |
| 209 | #define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf) | 209 | static inline struct nfs_fh *NFS_FH(const struct inode *inode) |
| 210 | #define NFS_MINATTRTIMEO(inode) \ | 210 | { |
| 211 | (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmin \ | 211 | return &NFS_I(inode)->fh; |
| 212 | : NFS_SERVER(inode)->acregmin) | 212 | } |
| 213 | #define NFS_MAXATTRTIMEO(inode) \ | 213 | |
| 214 | (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmax \ | 214 | static inline struct nfs_server *NFS_SERVER(const struct inode *inode) |
| 215 | : NFS_SERVER(inode)->acregmax) | 215 | { |
| 216 | 216 | return NFS_SB(inode->i_sb); | |
| 217 | #define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_I(inode)->flags)) | 217 | } |
| 218 | 218 | ||
| 219 | #define NFS_FILEID(inode) (NFS_I(inode)->fileid) | 219 | static inline struct rpc_clnt *NFS_CLIENT(const struct inode *inode) |
| 220 | { | ||
| 221 | return NFS_SERVER(inode)->client; | ||
| 222 | } | ||
| 223 | |||
| 224 | static inline const struct nfs_rpc_ops *NFS_PROTO(const struct inode *inode) | ||
| 225 | { | ||
| 226 | return NFS_SERVER(inode)->nfs_client->rpc_ops; | ||
| 227 | } | ||
| 228 | |||
| 229 | static inline __be32 *NFS_COOKIEVERF(const struct inode *inode) | ||
| 230 | { | ||
| 231 | return NFS_I(inode)->cookieverf; | ||
| 232 | } | ||
| 233 | |||
| 234 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) | ||
| 235 | { | ||
| 236 | struct nfs_server *nfss = NFS_SERVER(inode); | ||
| 237 | return S_ISDIR(inode->i_mode) ? nfss->acdirmin : nfss->acregmin; | ||
| 238 | } | ||
| 239 | |||
| 240 | static inline unsigned NFS_MAXATTRTIMEO(const struct inode *inode) | ||
| 241 | { | ||
| 242 | struct nfs_server *nfss = NFS_SERVER(inode); | ||
| 243 | return S_ISDIR(inode->i_mode) ? nfss->acdirmax : nfss->acregmax; | ||
| 244 | } | ||
| 245 | |||
| 246 | static inline int NFS_STALE(const struct inode *inode) | ||
| 247 | { | ||
| 248 | return test_bit(NFS_INO_STALE, &NFS_I(inode)->flags); | ||
| 249 | } | ||
| 250 | |||
| 251 | static inline __u64 NFS_FILEID(const struct inode *inode) | ||
| 252 | { | ||
| 253 | return NFS_I(inode)->fileid; | ||
| 254 | } | ||
| 255 | |||
| 256 | static inline void set_nfs_fileid(struct inode *inode, __u64 fileid) | ||
| 257 | { | ||
| 258 | NFS_I(inode)->fileid = fileid; | ||
| 259 | } | ||
| 220 | 260 | ||
| 221 | static inline void nfs_mark_for_revalidate(struct inode *inode) | 261 | static inline void nfs_mark_for_revalidate(struct inode *inode) |
| 222 | { | 262 | { |
