Skip to content

Commit 79a66e1

Browse files
Mike SnitzerTrond Myklebust
authored andcommitted
nfs/localio: eliminate need for nfs_local_fsync_work forward declaration
Move nfs_local_fsync_ctx_alloc() after nfs_local_fsync_work(). Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 0978e5b commit 79a66e1

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

fs/nfs/localio.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ struct nfs_local_fsync_ctx {
4444
struct work_struct work;
4545
struct completion *done;
4646
};
47-
static void nfs_local_fsync_work(struct work_struct *work);
4847

4948
static bool localio_enabled __read_mostly = true;
5049
module_param(localio_enabled, bool, 0644);
@@ -678,21 +677,6 @@ nfs_local_release_commit_data(struct nfsd_file *localio,
678677
call_ops->rpc_release(data);
679678
}
680679

681-
static struct nfs_local_fsync_ctx *
682-
nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data,
683-
struct nfsd_file *localio, gfp_t flags)
684-
{
685-
struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags);
686-
687-
if (ctx != NULL) {
688-
ctx->localio = localio;
689-
ctx->data = data;
690-
INIT_WORK(&ctx->work, nfs_local_fsync_work);
691-
ctx->done = NULL;
692-
}
693-
return ctx;
694-
}
695-
696680
static void
697681
nfs_local_fsync_ctx_free(struct nfs_local_fsync_ctx *ctx)
698682
{
@@ -717,6 +701,21 @@ nfs_local_fsync_work(struct work_struct *work)
717701
nfs_local_fsync_ctx_free(ctx);
718702
}
719703

704+
static struct nfs_local_fsync_ctx *
705+
nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data,
706+
struct nfsd_file *localio, gfp_t flags)
707+
{
708+
struct nfs_local_fsync_ctx *ctx = kmalloc(sizeof(*ctx), flags);
709+
710+
if (ctx != NULL) {
711+
ctx->localio = localio;
712+
ctx->data = data;
713+
INIT_WORK(&ctx->work, nfs_local_fsync_work);
714+
ctx->done = NULL;
715+
}
716+
return ctx;
717+
}
718+
720719
int nfs_local_commit(struct nfsd_file *localio,
721720
struct nfs_commit_data *data,
722721
const struct rpc_call_ops *call_ops, int how)

0 commit comments

Comments
 (0)