diff options
author | Jeff Layton <jlayton@poochiereds.net> | 2015-09-17 08:28:39 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-10-12 17:31:04 -0400 |
commit | aaf91ec148910e0c2bfd135ea19f870e7196e64f (patch) | |
tree | 0c97000244ac94b79728c8b9cba9ba81e1bec318 /fs/nfsd | |
parent | fcaba026a55803dd21523e6e191ba7f59e02a737 (diff) |
nfsd: switch unsigned char flags in svc_fh to bools
...just for clarity.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 5 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.h | 18 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 4 | ||||
-rw-r--r-- | fs/nfsd/vfs.h | 4 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 2 |
6 files changed, 17 insertions, 20 deletions
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index f6e7cbabac5a..00575d776d91 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
@@ -262,11 +262,11 @@ void fill_post_wcc(struct svc_fh *fhp) | |||
262 | err = fh_getattr(fhp, &fhp->fh_post_attr); | 262 | err = fh_getattr(fhp, &fhp->fh_post_attr); |
263 | fhp->fh_post_change = d_inode(fhp->fh_dentry)->i_version; | 263 | fhp->fh_post_change = d_inode(fhp->fh_dentry)->i_version; |
264 | if (err) { | 264 | if (err) { |
265 | fhp->fh_post_saved = 0; | 265 | fhp->fh_post_saved = false; |
266 | /* Grab the ctime anyway - set_change_info might use it */ | 266 | /* Grab the ctime anyway - set_change_info might use it */ |
267 | fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime; | 267 | fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime; |
268 | } else | 268 | } else |
269 | fhp->fh_post_saved = 1; | 269 | fhp->fh_post_saved = true; |
270 | } | 270 | } |
271 | 271 | ||
272 | /* | 272 | /* |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 350041a40fe5..c1681ce894c5 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -631,10 +631,7 @@ fh_put(struct svc_fh *fhp) | |||
631 | fh_unlock(fhp); | 631 | fh_unlock(fhp); |
632 | fhp->fh_dentry = NULL; | 632 | fhp->fh_dentry = NULL; |
633 | dput(dentry); | 633 | dput(dentry); |
634 | #ifdef CONFIG_NFSD_V3 | 634 | fh_clear_wcc(fhp); |
635 | fhp->fh_pre_saved = 0; | ||
636 | fhp->fh_post_saved = 0; | ||
637 | #endif | ||
638 | } | 635 | } |
639 | fh_drop_write(fhp); | 636 | fh_drop_write(fhp); |
640 | if (exp) { | 637 | if (exp) { |
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h index b1edd6bf40e1..2087bae17582 100644 --- a/fs/nfsd/nfsfh.h +++ b/fs/nfsd/nfsfh.h | |||
@@ -30,12 +30,12 @@ typedef struct svc_fh { | |||
30 | struct dentry * fh_dentry; /* validated dentry */ | 30 | struct dentry * fh_dentry; /* validated dentry */ |
31 | struct svc_export * fh_export; /* export pointer */ | 31 | struct svc_export * fh_export; /* export pointer */ |
32 | 32 | ||
33 | unsigned char fh_locked; /* inode locked by us */ | 33 | bool fh_locked; /* inode locked by us */ |
34 | unsigned char fh_want_write; /* remount protection taken */ | 34 | bool fh_want_write; /* remount protection taken */ |
35 | 35 | ||
36 | #ifdef CONFIG_NFSD_V3 | 36 | #ifdef CONFIG_NFSD_V3 |
37 | unsigned char fh_post_saved; /* post-op attrs saved */ | 37 | bool fh_post_saved; /* post-op attrs saved */ |
38 | unsigned char fh_pre_saved; /* pre-op attrs saved */ | 38 | bool fh_pre_saved; /* pre-op attrs saved */ |
39 | 39 | ||
40 | /* Pre-op attributes saved during fh_lock */ | 40 | /* Pre-op attributes saved during fh_lock */ |
41 | __u64 fh_pre_size; /* size before operation */ | 41 | __u64 fh_pre_size; /* size before operation */ |
@@ -213,8 +213,8 @@ static inline bool fh_fsid_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2) | |||
213 | static inline void | 213 | static inline void |
214 | fh_clear_wcc(struct svc_fh *fhp) | 214 | fh_clear_wcc(struct svc_fh *fhp) |
215 | { | 215 | { |
216 | fhp->fh_post_saved = 0; | 216 | fhp->fh_post_saved = false; |
217 | fhp->fh_pre_saved = 0; | 217 | fhp->fh_pre_saved = false; |
218 | } | 218 | } |
219 | 219 | ||
220 | /* | 220 | /* |
@@ -231,7 +231,7 @@ fill_pre_wcc(struct svc_fh *fhp) | |||
231 | fhp->fh_pre_ctime = inode->i_ctime; | 231 | fhp->fh_pre_ctime = inode->i_ctime; |
232 | fhp->fh_pre_size = inode->i_size; | 232 | fhp->fh_pre_size = inode->i_size; |
233 | fhp->fh_pre_change = inode->i_version; | 233 | fhp->fh_pre_change = inode->i_version; |
234 | fhp->fh_pre_saved = 1; | 234 | fhp->fh_pre_saved = true; |
235 | } | 235 | } |
236 | } | 236 | } |
237 | 237 | ||
@@ -267,7 +267,7 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) | |||
267 | inode = d_inode(dentry); | 267 | inode = d_inode(dentry); |
268 | mutex_lock_nested(&inode->i_mutex, subclass); | 268 | mutex_lock_nested(&inode->i_mutex, subclass); |
269 | fill_pre_wcc(fhp); | 269 | fill_pre_wcc(fhp); |
270 | fhp->fh_locked = 1; | 270 | fhp->fh_locked = true; |
271 | } | 271 | } |
272 | 272 | ||
273 | static inline void | 273 | static inline void |
@@ -285,7 +285,7 @@ fh_unlock(struct svc_fh *fhp) | |||
285 | if (fhp->fh_locked) { | 285 | if (fhp->fh_locked) { |
286 | fill_post_wcc(fhp); | 286 | fill_post_wcc(fhp); |
287 | mutex_unlock(&d_inode(fhp->fh_dentry)->i_mutex); | 287 | mutex_unlock(&d_inode(fhp->fh_dentry)->i_mutex); |
288 | fhp->fh_locked = 0; | 288 | fhp->fh_locked = false; |
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 45c04979e7b3..994d66fbb446 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1631,7 +1631,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, | |||
1631 | /* cannot use fh_lock as we need deadlock protective ordering | 1631 | /* cannot use fh_lock as we need deadlock protective ordering |
1632 | * so do it by hand */ | 1632 | * so do it by hand */ |
1633 | trap = lock_rename(tdentry, fdentry); | 1633 | trap = lock_rename(tdentry, fdentry); |
1634 | ffhp->fh_locked = tfhp->fh_locked = 1; | 1634 | ffhp->fh_locked = tfhp->fh_locked = true; |
1635 | fill_pre_wcc(ffhp); | 1635 | fill_pre_wcc(ffhp); |
1636 | fill_pre_wcc(tfhp); | 1636 | fill_pre_wcc(tfhp); |
1637 | 1637 | ||
@@ -1681,7 +1681,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, | |||
1681 | fill_post_wcc(ffhp); | 1681 | fill_post_wcc(ffhp); |
1682 | fill_post_wcc(tfhp); | 1682 | fill_post_wcc(tfhp); |
1683 | unlock_rename(tdentry, fdentry); | 1683 | unlock_rename(tdentry, fdentry); |
1684 | ffhp->fh_locked = tfhp->fh_locked = 0; | 1684 | ffhp->fh_locked = tfhp->fh_locked = false; |
1685 | fh_drop_write(ffhp); | 1685 | fh_drop_write(ffhp); |
1686 | 1686 | ||
1687 | out: | 1687 | out: |
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h index fee2451ae248..fcfc48cbe136 100644 --- a/fs/nfsd/vfs.h +++ b/fs/nfsd/vfs.h | |||
@@ -112,14 +112,14 @@ static inline int fh_want_write(struct svc_fh *fh) | |||
112 | int ret = mnt_want_write(fh->fh_export->ex_path.mnt); | 112 | int ret = mnt_want_write(fh->fh_export->ex_path.mnt); |
113 | 113 | ||
114 | if (!ret) | 114 | if (!ret) |
115 | fh->fh_want_write = 1; | 115 | fh->fh_want_write = true; |
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline void fh_drop_write(struct svc_fh *fh) | 119 | static inline void fh_drop_write(struct svc_fh *fh) |
120 | { | 120 | { |
121 | if (fh->fh_want_write) { | 121 | if (fh->fh_want_write) { |
122 | fh->fh_want_write = 0; | 122 | fh->fh_want_write = false; |
123 | mnt_drop_write(fh->fh_export->ex_path.mnt); | 123 | mnt_drop_write(fh->fh_export->ex_path.mnt); |
124 | } | 124 | } |
125 | } | 125 | } |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 9f991007a578..ce7362c88b48 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -632,7 +632,7 @@ static inline void | |||
632 | set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | 632 | set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) |
633 | { | 633 | { |
634 | BUG_ON(!fhp->fh_pre_saved); | 634 | BUG_ON(!fhp->fh_pre_saved); |
635 | cinfo->atomic = fhp->fh_post_saved; | 635 | cinfo->atomic = (u32)fhp->fh_post_saved; |
636 | cinfo->change_supported = IS_I_VERSION(d_inode(fhp->fh_dentry)); | 636 | cinfo->change_supported = IS_I_VERSION(d_inode(fhp->fh_dentry)); |
637 | 637 | ||
638 | cinfo->before_change = fhp->fh_pre_change; | 638 | cinfo->before_change = fhp->fh_pre_change; |