Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jeff Layton and committed by
J. Bruce Fields
aaf91ec1 fcaba026

+17 -20
+2 -2
fs/nfsd/nfs3xdr.c
··· 262 262 err = fh_getattr(fhp, &fhp->fh_post_attr); 263 263 fhp->fh_post_change = d_inode(fhp->fh_dentry)->i_version; 264 264 if (err) { 265 - fhp->fh_post_saved = 0; 265 + fhp->fh_post_saved = false; 266 266 /* Grab the ctime anyway - set_change_info might use it */ 267 267 fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime; 268 268 } else 269 - fhp->fh_post_saved = 1; 269 + fhp->fh_post_saved = true; 270 270 } 271 271 272 272 /*
+1 -4
fs/nfsd/nfsfh.c
··· 631 631 fh_unlock(fhp); 632 632 fhp->fh_dentry = NULL; 633 633 dput(dentry); 634 - #ifdef CONFIG_NFSD_V3 635 - fhp->fh_pre_saved = 0; 636 - fhp->fh_post_saved = 0; 637 - #endif 634 + fh_clear_wcc(fhp); 638 635 } 639 636 fh_drop_write(fhp); 640 637 if (exp) {
+9 -9
fs/nfsd/nfsfh.h
··· 30 30 struct dentry * fh_dentry; /* validated dentry */ 31 31 struct svc_export * fh_export; /* export pointer */ 32 32 33 - unsigned char fh_locked; /* inode locked by us */ 34 - unsigned char fh_want_write; /* remount protection taken */ 33 + bool fh_locked; /* inode locked by us */ 34 + bool fh_want_write; /* remount protection taken */ 35 35 36 36 #ifdef CONFIG_NFSD_V3 37 - unsigned char fh_post_saved; /* post-op attrs saved */ 38 - unsigned char fh_pre_saved; /* pre-op attrs saved */ 37 + bool fh_post_saved; /* post-op attrs saved */ 38 + bool fh_pre_saved; /* pre-op attrs saved */ 39 39 40 40 /* Pre-op attributes saved during fh_lock */ 41 41 __u64 fh_pre_size; /* size before operation */ ··· 213 213 static inline void 214 214 fh_clear_wcc(struct svc_fh *fhp) 215 215 { 216 - fhp->fh_post_saved = 0; 217 - fhp->fh_pre_saved = 0; 216 + fhp->fh_post_saved = false; 217 + fhp->fh_pre_saved = false; 218 218 } 219 219 220 220 /* ··· 231 231 fhp->fh_pre_ctime = inode->i_ctime; 232 232 fhp->fh_pre_size = inode->i_size; 233 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 267 inode = d_inode(dentry); 268 268 mutex_lock_nested(&inode->i_mutex, subclass); 269 269 fill_pre_wcc(fhp); 270 - fhp->fh_locked = 1; 270 + fhp->fh_locked = true; 271 271 } 272 272 273 273 static inline void ··· 285 285 if (fhp->fh_locked) { 286 286 fill_post_wcc(fhp); 287 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
+2 -2
fs/nfsd/vfs.c
··· 1631 1631 /* cannot use fh_lock as we need deadlock protective ordering 1632 1632 * so do it by hand */ 1633 1633 trap = lock_rename(tdentry, fdentry); 1634 - ffhp->fh_locked = tfhp->fh_locked = 1; 1634 + ffhp->fh_locked = tfhp->fh_locked = true; 1635 1635 fill_pre_wcc(ffhp); 1636 1636 fill_pre_wcc(tfhp); 1637 1637 ··· 1681 1681 fill_post_wcc(ffhp); 1682 1682 fill_post_wcc(tfhp); 1683 1683 unlock_rename(tdentry, fdentry); 1684 - ffhp->fh_locked = tfhp->fh_locked = 0; 1684 + ffhp->fh_locked = tfhp->fh_locked = false; 1685 1685 fh_drop_write(ffhp); 1686 1686 1687 1687 out:
+2 -2
fs/nfsd/vfs.h
··· 112 112 int ret = mnt_want_write(fh->fh_export->ex_path.mnt); 113 113 114 114 if (!ret) 115 - fh->fh_want_write = 1; 115 + fh->fh_want_write = true; 116 116 return ret; 117 117 } 118 118 119 119 static inline void fh_drop_write(struct svc_fh *fh) 120 120 { 121 121 if (fh->fh_want_write) { 122 - fh->fh_want_write = 0; 122 + fh->fh_want_write = false; 123 123 mnt_drop_write(fh->fh_export->ex_path.mnt); 124 124 } 125 125 }
+1 -1
fs/nfsd/xdr4.h
··· 632 632 set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) 633 633 { 634 634 BUG_ON(!fhp->fh_pre_saved); 635 - cinfo->atomic = fhp->fh_post_saved; 635 + cinfo->atomic = (u32)fhp->fh_post_saved; 636 636 cinfo->change_supported = IS_I_VERSION(d_inode(fhp->fh_dentry)); 637 637 638 638 cinfo->before_change = fhp->fh_pre_change;