summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/dir.c16
-rw-r--r--fs/nfs/internal.h6
-rw-r--r--fs/nfs/nfs2xdr.c2
-rw-r--r--fs/nfs/nfs3proc.c2
-rw-r--r--fs/nfs/nfs3xdr.c2
-rw-r--r--fs/nfs/nfs4proc.c42
-rw-r--r--fs/nfs/nfs4xdr.c2
-rw-r--r--fs/nfs/proc.c2
-rw-r--r--include/linux/nfs_xdr.h10
9 files changed, 42 insertions, 42 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 32ccd7754f8a..9688e9bb13dc 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -151,7 +151,7 @@ struct nfs_cache_array {
151 struct nfs_cache_array_entry array[0]; 151 struct nfs_cache_array_entry array[0];
152}; 152};
153 153
154typedef int (*decode_dirent_t)(struct xdr_stream *, struct nfs_entry *, int); 154typedef int (*decode_dirent_t)(struct xdr_stream *, struct nfs_entry *, bool);
155typedef struct { 155typedef struct {
156 struct file *file; 156 struct file *file;
157 struct page *page; 157 struct page *page;
@@ -165,8 +165,8 @@ typedef struct {
165 unsigned long timestamp; 165 unsigned long timestamp;
166 unsigned long gencount; 166 unsigned long gencount;
167 unsigned int cache_entry_index; 167 unsigned int cache_entry_index;
168 unsigned int plus:1; 168 bool plus;
169 unsigned int eof:1; 169 bool eof;
170} nfs_readdir_descriptor_t; 170} nfs_readdir_descriptor_t;
171 171
172/* 172/*
@@ -355,7 +355,7 @@ int nfs_readdir_xdr_filler(struct page **pages, nfs_readdir_descriptor_t *desc,
355 if (error == -ENOTSUPP && desc->plus) { 355 if (error == -ENOTSUPP && desc->plus) {
356 NFS_SERVER(inode)->caps &= ~NFS_CAP_READDIRPLUS; 356 NFS_SERVER(inode)->caps &= ~NFS_CAP_READDIRPLUS;
357 clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags); 357 clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags);
358 desc->plus = 0; 358 desc->plus = false;
359 goto again; 359 goto again;
360 } 360 }
361 goto error; 361 goto error;
@@ -557,7 +557,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en
557 557
558 count++; 558 count++;
559 559
560 if (desc->plus != 0) 560 if (desc->plus)
561 nfs_prime_dcache(file_dentry(desc->file), entry); 561 nfs_prime_dcache(file_dentry(desc->file), entry);
562 562
563 status = nfs_readdir_add_to_array(entry, page); 563 status = nfs_readdir_add_to_array(entry, page);
@@ -860,7 +860,7 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
860 desc->ctx = ctx; 860 desc->ctx = ctx;
861 desc->dir_cookie = &dir_ctx->dir_cookie; 861 desc->dir_cookie = &dir_ctx->dir_cookie;
862 desc->decode = NFS_PROTO(inode)->decode_dirent; 862 desc->decode = NFS_PROTO(inode)->decode_dirent;
863 desc->plus = nfs_use_readdirplus(inode, ctx) ? 1 : 0; 863 desc->plus = nfs_use_readdirplus(inode, ctx);
864 864
865 if (ctx->pos == 0 || nfs_attribute_cache_expired(inode)) 865 if (ctx->pos == 0 || nfs_attribute_cache_expired(inode))
866 res = nfs_revalidate_mapping(inode, file->f_mapping); 866 res = nfs_revalidate_mapping(inode, file->f_mapping);
@@ -885,8 +885,8 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
885 clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags); 885 clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags);
886 nfs_zap_caches(inode); 886 nfs_zap_caches(inode);
887 desc->page_index = 0; 887 desc->page_index = 0;
888 desc->plus = 0; 888 desc->plus = false;
889 desc->eof = 0; 889 desc->eof = false;
890 continue; 890 continue;
891 } 891 }
892 if (res < 0) 892 if (res < 0)
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 1c0ce9c15e94..c5054edb0157 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -272,17 +272,17 @@ static inline bool nfs_match_open_context(const struct nfs_open_context *ctx1,
272/* nfs2xdr.c */ 272/* nfs2xdr.c */
273extern const struct rpc_procinfo nfs_procedures[]; 273extern const struct rpc_procinfo nfs_procedures[];
274extern int nfs2_decode_dirent(struct xdr_stream *, 274extern int nfs2_decode_dirent(struct xdr_stream *,
275 struct nfs_entry *, int); 275 struct nfs_entry *, bool);
276 276
277/* nfs3xdr.c */ 277/* nfs3xdr.c */
278extern const struct rpc_procinfo nfs3_procedures[]; 278extern const struct rpc_procinfo nfs3_procedures[];
279extern int nfs3_decode_dirent(struct xdr_stream *, 279extern int nfs3_decode_dirent(struct xdr_stream *,
280 struct nfs_entry *, int); 280 struct nfs_entry *, bool);
281 281
282/* nfs4xdr.c */ 282/* nfs4xdr.c */
283#if IS_ENABLED(CONFIG_NFS_V4) 283#if IS_ENABLED(CONFIG_NFS_V4)
284extern int nfs4_decode_dirent(struct xdr_stream *, 284extern int nfs4_decode_dirent(struct xdr_stream *,
285 struct nfs_entry *, int); 285 struct nfs_entry *, bool);
286#endif 286#endif
287#ifdef CONFIG_NFS_V4_1 287#ifdef CONFIG_NFS_V4_1
288extern const u32 nfs41_maxread_overhead; 288extern const u32 nfs41_maxread_overhead;
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index c8a7e98c1371..fe68dabfbde6 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -939,7 +939,7 @@ static int nfs2_xdr_dec_writeres(struct rpc_rqst *req, struct xdr_stream *xdr,
939 * }; 939 * };
940 */ 940 */
941int nfs2_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, 941int nfs2_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
942 int plus) 942 bool plus)
943{ 943{
944 __be32 *p; 944 __be32 *p;
945 int error; 945 int error;
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 0c07b567118d..df4a7d3ab915 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -621,7 +621,7 @@ out:
621 */ 621 */
622static int 622static int
623nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 623nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
624 u64 cookie, struct page **pages, unsigned int count, int plus) 624 u64 cookie, struct page **pages, unsigned int count, bool plus)
625{ 625{
626 struct inode *dir = d_inode(dentry); 626 struct inode *dir = d_inode(dentry);
627 __be32 *verf = NFS_I(dir)->cookieverf; 627 __be32 *verf = NFS_I(dir)->cookieverf;
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 670eddb3ae36..e82c9e553224 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -1991,7 +1991,7 @@ out_status:
1991 * }; 1991 * };
1992 */ 1992 */
1993int nfs3_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, 1993int nfs3_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
1994 int plus) 1994 bool plus)
1995{ 1995{
1996 struct nfs_entry old = *entry; 1996 struct nfs_entry old = *entry;
1997 __be32 *p; 1997 __be32 *p;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 735b3068a2d1..e678fa8f6979 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1037,11 +1037,11 @@ struct nfs4_opendata {
1037 struct nfs4_state *state; 1037 struct nfs4_state *state;
1038 struct iattr attrs; 1038 struct iattr attrs;
1039 unsigned long timestamp; 1039 unsigned long timestamp;
1040 unsigned int rpc_done : 1; 1040 bool rpc_done;
1041 unsigned int file_created : 1; 1041 bool file_created;
1042 unsigned int is_recover : 1; 1042 bool is_recover;
1043 bool cancelled;
1043 int rpc_status; 1044 int rpc_status;
1044 int cancelled;
1045}; 1045};
1046 1046
1047static bool nfs4_clear_cap_atomic_open_v1(struct nfs_server *server, 1047static bool nfs4_clear_cap_atomic_open_v1(struct nfs_server *server,
@@ -1965,7 +1965,7 @@ static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata)
1965 nfs4_stateid_copy(&data->o_res.stateid, &data->c_res.stateid); 1965 nfs4_stateid_copy(&data->o_res.stateid, &data->c_res.stateid);
1966 nfs_confirm_seqid(&data->owner->so_seqid, 0); 1966 nfs_confirm_seqid(&data->owner->so_seqid, 0);
1967 renew_lease(data->o_res.server, data->timestamp); 1967 renew_lease(data->o_res.server, data->timestamp);
1968 data->rpc_done = 1; 1968 data->rpc_done = true;
1969 } 1969 }
1970} 1970}
1971 1971
@@ -1975,7 +1975,7 @@ static void nfs4_open_confirm_release(void *calldata)
1975 struct nfs4_state *state = NULL; 1975 struct nfs4_state *state = NULL;
1976 1976
1977 /* If this request hasn't been cancelled, do nothing */ 1977 /* If this request hasn't been cancelled, do nothing */
1978 if (data->cancelled == 0) 1978 if (!data->cancelled)
1979 goto out_free; 1979 goto out_free;
1980 /* In case of error, no cleanup! */ 1980 /* In case of error, no cleanup! */
1981 if (!data->rpc_done) 1981 if (!data->rpc_done)
@@ -2018,7 +2018,7 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
2018 2018
2019 nfs4_init_sequence(&data->c_arg.seq_args, &data->c_res.seq_res, 1); 2019 nfs4_init_sequence(&data->c_arg.seq_args, &data->c_res.seq_res, 1);
2020 kref_get(&data->kref); 2020 kref_get(&data->kref);
2021 data->rpc_done = 0; 2021 data->rpc_done = false;
2022 data->rpc_status = 0; 2022 data->rpc_status = 0;
2023 data->timestamp = jiffies; 2023 data->timestamp = jiffies;
2024 if (data->is_recover) 2024 if (data->is_recover)
@@ -2028,7 +2028,7 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
2028 return PTR_ERR(task); 2028 return PTR_ERR(task);
2029 status = rpc_wait_for_completion_task(task); 2029 status = rpc_wait_for_completion_task(task);
2030 if (status != 0) { 2030 if (status != 0) {
2031 data->cancelled = 1; 2031 data->cancelled = true;
2032 smp_wmb(); 2032 smp_wmb();
2033 } else 2033 } else
2034 status = data->rpc_status; 2034 status = data->rpc_status;
@@ -2127,7 +2127,7 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata)
2127 if (!(data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM)) 2127 if (!(data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM))
2128 nfs_confirm_seqid(&data->owner->so_seqid, 0); 2128 nfs_confirm_seqid(&data->owner->so_seqid, 0);
2129 } 2129 }
2130 data->rpc_done = 1; 2130 data->rpc_done = true;
2131} 2131}
2132 2132
2133static void nfs4_open_release(void *calldata) 2133static void nfs4_open_release(void *calldata)
@@ -2136,7 +2136,7 @@ static void nfs4_open_release(void *calldata)
2136 struct nfs4_state *state = NULL; 2136 struct nfs4_state *state = NULL;
2137 2137
2138 /* If this request hasn't been cancelled, do nothing */ 2138 /* If this request hasn't been cancelled, do nothing */
2139 if (data->cancelled == 0) 2139 if (!data->cancelled)
2140 goto out_free; 2140 goto out_free;
2141 /* In case of error, no cleanup! */ 2141 /* In case of error, no cleanup! */
2142 if (data->rpc_status != 0 || !data->rpc_done) 2142 if (data->rpc_status != 0 || !data->rpc_done)
@@ -2182,20 +2182,20 @@ static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover)
2182 2182
2183 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1); 2183 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1);
2184 kref_get(&data->kref); 2184 kref_get(&data->kref);
2185 data->rpc_done = 0; 2185 data->rpc_done = false;
2186 data->rpc_status = 0; 2186 data->rpc_status = 0;
2187 data->cancelled = 0; 2187 data->cancelled = false;
2188 data->is_recover = 0; 2188 data->is_recover = false;
2189 if (isrecover) { 2189 if (isrecover) {
2190 nfs4_set_sequence_privileged(&o_arg->seq_args); 2190 nfs4_set_sequence_privileged(&o_arg->seq_args);
2191 data->is_recover = 1; 2191 data->is_recover = true;
2192 } 2192 }
2193 task = rpc_run_task(&task_setup_data); 2193 task = rpc_run_task(&task_setup_data);
2194 if (IS_ERR(task)) 2194 if (IS_ERR(task))
2195 return PTR_ERR(task); 2195 return PTR_ERR(task);
2196 status = rpc_wait_for_completion_task(task); 2196 status = rpc_wait_for_completion_task(task);
2197 if (status != 0) { 2197 if (status != 0) {
2198 data->cancelled = 1; 2198 data->cancelled = true;
2199 smp_wmb(); 2199 smp_wmb();
2200 } else 2200 } else
2201 status = data->rpc_status; 2201 status = data->rpc_status;
@@ -2290,9 +2290,9 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
2290 2290
2291 if (o_arg->open_flags & O_CREAT) { 2291 if (o_arg->open_flags & O_CREAT) {
2292 if (o_arg->open_flags & O_EXCL) 2292 if (o_arg->open_flags & O_EXCL)
2293 data->file_created = 1; 2293 data->file_created = true;
2294 else if (o_res->cinfo.before != o_res->cinfo.after) 2294 else if (o_res->cinfo.before != o_res->cinfo.after)
2295 data->file_created = 1; 2295 data->file_created = true;
2296 if (data->file_created || dir->i_version != o_res->cinfo.after) 2296 if (data->file_created || dir->i_version != o_res->cinfo.after)
2297 update_changeattr(dir, &o_res->cinfo, 2297 update_changeattr(dir, &o_res->cinfo,
2298 o_res->f_attr->time_start); 2298 o_res->f_attr->time_start);
@@ -4275,7 +4275,7 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
4275} 4275}
4276 4276
4277static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 4277static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
4278 u64 cookie, struct page **pages, unsigned int count, int plus) 4278 u64 cookie, struct page **pages, unsigned int count, bool plus)
4279{ 4279{
4280 struct inode *dir = d_inode(dentry); 4280 struct inode *dir = d_inode(dentry);
4281 struct nfs4_readdir_arg args = { 4281 struct nfs4_readdir_arg args = {
@@ -4313,7 +4313,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
4313} 4313}
4314 4314
4315static int nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 4315static int nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
4316 u64 cookie, struct page **pages, unsigned int count, int plus) 4316 u64 cookie, struct page **pages, unsigned int count, bool plus)
4317{ 4317{
4318 struct nfs4_exception exception = { }; 4318 struct nfs4_exception exception = { };
4319 int err; 4319 int err;
@@ -6137,7 +6137,7 @@ static void nfs4_lock_release(void *calldata)
6137 6137
6138 dprintk("%s: begin!\n", __func__); 6138 dprintk("%s: begin!\n", __func__);
6139 nfs_free_seqid(data->arg.open_seqid); 6139 nfs_free_seqid(data->arg.open_seqid);
6140 if (data->cancelled != 0) { 6140 if (data->cancelled) {
6141 struct rpc_task *task; 6141 struct rpc_task *task;
6142 task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp, 6142 task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp,
6143 data->arg.lock_seqid); 6143 data->arg.lock_seqid);
@@ -6220,7 +6220,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
6220 nfs4_handle_setlk_error(data->server, data->lsp, 6220 nfs4_handle_setlk_error(data->server, data->lsp,
6221 data->arg.new_lock_owner, ret); 6221 data->arg.new_lock_owner, ret);
6222 } else 6222 } else
6223 data->cancelled = 1; 6223 data->cancelled = true;
6224 rpc_put_task(task); 6224 rpc_put_task(task);
6225 dprintk("%s: done, ret = %d!\n", __func__, ret); 6225 dprintk("%s: done, ret = %d!\n", __func__, ret);
6226 trace_nfs4_set_lock(fl, state, &data->res.stateid, cmd, ret); 6226 trace_nfs4_set_lock(fl, state, &data->res.stateid, cmd, ret);
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 0f1f290c97cd..495d493d3a35 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -7447,7 +7447,7 @@ out:
7447 * on a directory already in our cache. 7447 * on a directory already in our cache.
7448 */ 7448 */
7449int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, 7449int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
7450 int plus) 7450 bool plus)
7451{ 7451{
7452 unsigned int savep; 7452 unsigned int savep;
7453 uint32_t bitmap[3] = {0}; 7453 uint32_t bitmap[3] = {0};
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 9872cf676a50..7962e49097c3 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -485,7 +485,7 @@ nfs_proc_rmdir(struct inode *dir, const struct qstr *name)
485 */ 485 */
486static int 486static int
487nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 487nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
488 u64 cookie, struct page **pages, unsigned int count, int plus) 488 u64 cookie, struct page **pages, unsigned int count, bool plus)
489{ 489{
490 struct inode *dir = d_inode(dentry); 490 struct inode *dir = d_inode(dentry);
491 struct nfs_readdirargs arg = { 491 struct nfs_readdirargs arg = {
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index b28c83475ee8..9b42bffbe07b 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -878,7 +878,7 @@ struct nfs3_readdirargs {
878 struct nfs_fh * fh; 878 struct nfs_fh * fh;
879 __u64 cookie; 879 __u64 cookie;
880 __be32 verf[2]; 880 __be32 verf[2];
881 int plus; 881 bool plus;
882 unsigned int count; 882 unsigned int count;
883 struct page ** pages; 883 struct page ** pages;
884}; 884};
@@ -909,7 +909,7 @@ struct nfs3_linkres {
909struct nfs3_readdirres { 909struct nfs3_readdirres {
910 struct nfs_fattr * dir_attr; 910 struct nfs_fattr * dir_attr;
911 __be32 * verf; 911 __be32 * verf;
912 int plus; 912 bool plus;
913}; 913};
914 914
915struct nfs3_getaclres { 915struct nfs3_getaclres {
@@ -1053,7 +1053,7 @@ struct nfs4_readdir_arg {
1053 struct page ** pages; /* zero-copy data */ 1053 struct page ** pages; /* zero-copy data */
1054 unsigned int pgbase; /* zero-copy data */ 1054 unsigned int pgbase; /* zero-copy data */
1055 const u32 * bitmask; 1055 const u32 * bitmask;
1056 int plus; 1056 bool plus;
1057}; 1057};
1058 1058
1059struct nfs4_readdir_res { 1059struct nfs4_readdir_res {
@@ -1585,7 +1585,7 @@ struct nfs_rpc_ops {
1585 int (*mkdir) (struct inode *, struct dentry *, struct iattr *); 1585 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1586 int (*rmdir) (struct inode *, const struct qstr *); 1586 int (*rmdir) (struct inode *, const struct qstr *);
1587 int (*readdir) (struct dentry *, struct rpc_cred *, 1587 int (*readdir) (struct dentry *, struct rpc_cred *,
1588 u64, struct page **, unsigned int, int); 1588 u64, struct page **, unsigned int, bool);
1589 int (*mknod) (struct inode *, struct dentry *, struct iattr *, 1589 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1590 dev_t); 1590 dev_t);
1591 int (*statfs) (struct nfs_server *, struct nfs_fh *, 1591 int (*statfs) (struct nfs_server *, struct nfs_fh *,
@@ -1595,7 +1595,7 @@ struct nfs_rpc_ops {
1595 int (*pathconf) (struct nfs_server *, struct nfs_fh *, 1595 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1596 struct nfs_pathconf *); 1596 struct nfs_pathconf *);
1597 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 1597 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1598 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); 1598 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool);
1599 int (*pgio_rpc_prepare)(struct rpc_task *, 1599 int (*pgio_rpc_prepare)(struct rpc_task *,
1600 struct nfs_pgio_header *); 1600 struct nfs_pgio_header *);
1601 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *); 1601 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *);