Message ID | 20241108234002.16392-7-snitzer@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | nfs/nfsd: fixes and improvements for LOCALIO | expand |
On Sat, 09 Nov 2024, Mike Snitzer wrote: > Move nfs_local_fsync_ctx_alloc() after nfs_local_fsync_work(). > > Signed-off-by: Mike Snitzer <snitzer@kernel.org> Nice. Reviewed-by: NeilBrown <neilb@suse.de> Thanks, NeilBrown > --- > fs/nfs/localio.c | 31 +++++++++++++++---------------- > 1 file changed, 15 insertions(+), 16 deletions(-) > > diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c > index a77ac7e8a05c..4b8618cf114c 100644 > --- a/fs/nfs/localio.c > +++ b/fs/nfs/localio.c > @@ -44,7 +44,6 @@ struct nfs_local_fsync_ctx { > struct work_struct work; > struct completion *done; > }; > -static void nfs_local_fsync_work(struct work_struct *work); > > static bool localio_enabled __read_mostly = true; > module_param(localio_enabled, bool, 0644); > @@ -684,21 +683,6 @@ nfs_local_release_commit_data(struct nfsd_file *localio, > call_ops->rpc_release(data); > } > > -static struct nfs_local_fsync_ctx * > -nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data, > - struct nfsd_file *localio, gfp_t flags) > -{ > - struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags); > - > - if (ctx != NULL) { > - ctx->localio = localio; > - ctx->data = data; > - INIT_WORK(&ctx->work, nfs_local_fsync_work); > - ctx->done = NULL; > - } > - return ctx; > -} > - > static void > nfs_local_fsync_ctx_free(struct nfs_local_fsync_ctx *ctx) > { > @@ -723,6 +707,21 @@ nfs_local_fsync_work(struct work_struct *work) > nfs_local_fsync_ctx_free(ctx); > } > > +static struct nfs_local_fsync_ctx * > +nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data, > + struct nfsd_file *localio, gfp_t flags) > +{ > + struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags); > + > + if (ctx != NULL) { > + ctx->localio = localio; > + ctx->data = data; > + INIT_WORK(&ctx->work, nfs_local_fsync_work); > + ctx->done = NULL; > + } > + return ctx; > +} > + > int nfs_local_commit(struct nfsd_file *localio, > struct nfs_commit_data *data, > const struct rpc_call_ops *call_ops, int how) > -- > 2.44.0 > >
diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c index a77ac7e8a05c..4b8618cf114c 100644 --- a/fs/nfs/localio.c +++ b/fs/nfs/localio.c @@ -44,7 +44,6 @@ struct nfs_local_fsync_ctx { struct work_struct work; struct completion *done; }; -static void nfs_local_fsync_work(struct work_struct *work); static bool localio_enabled __read_mostly = true; module_param(localio_enabled, bool, 0644); @@ -684,21 +683,6 @@ nfs_local_release_commit_data(struct nfsd_file *localio, call_ops->rpc_release(data); } -static struct nfs_local_fsync_ctx * -nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data, - struct nfsd_file *localio, gfp_t flags) -{ - struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags); - - if (ctx != NULL) { - ctx->localio = localio; - ctx->data = data; - INIT_WORK(&ctx->work, nfs_local_fsync_work); - ctx->done = NULL; - } - return ctx; -} - static void nfs_local_fsync_ctx_free(struct nfs_local_fsync_ctx *ctx) { @@ -723,6 +707,21 @@ nfs_local_fsync_work(struct work_struct *work) nfs_local_fsync_ctx_free(ctx); } +static struct nfs_local_fsync_ctx * +nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data, + struct nfsd_file *localio, gfp_t flags) +{ + struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags); + + if (ctx != NULL) { + ctx->localio = localio; + ctx->data = data; + INIT_WORK(&ctx->work, nfs_local_fsync_work); + ctx->done = NULL; + } + return ctx; +} + int nfs_local_commit(struct nfsd_file *localio, struct nfs_commit_data *data, const struct rpc_call_ops *call_ops, int how)
Move nfs_local_fsync_ctx_alloc() after nfs_local_fsync_work(). Signed-off-by: Mike Snitzer <snitzer@kernel.org> --- fs/nfs/localio.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)