lkml.org 
[lkml]   [2022]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH v2 17/19] netfs: Split some core bits out into their own file
    From
    Date
    Split some core bits out into their own file.  More bits will be added to
    this file later.

    Signed-off-by: David Howells <dhowells@redhat.com>
    cc: linux-cachefs@redhat.com

    Link: https://lore.kernel.org/r/164623006934.3564931.17932680017894039748.stgit@warthog.procyon.org.uk/ # v1
    ---

    fs/netfs/Makefile | 1 +
    fs/netfs/internal.h | 7 +++++--
    fs/netfs/io.c | 10 ----------
    fs/netfs/main.c | 20 ++++++++++++++++++++
    4 files changed, 26 insertions(+), 12 deletions(-)
    create mode 100644 fs/netfs/main.c

    diff --git a/fs/netfs/Makefile b/fs/netfs/Makefile
    index 88b904532bc7..f684c0cd1ec5 100644
    --- a/fs/netfs/Makefile
    +++ b/fs/netfs/Makefile
    @@ -3,6 +3,7 @@
    netfs-y := \
    buffered_read.o \
    io.o \
    + main.o \
    objects.o

    netfs-$(CONFIG_NETFS_STATS) += stats.o
    diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h
    index 1cd2778bfa7d..622b421d4753 100644
    --- a/fs/netfs/internal.h
    +++ b/fs/netfs/internal.h
    @@ -23,10 +23,13 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq);
    /*
    * io.c
    */
    -extern unsigned int netfs_debug;
    -
    int netfs_begin_read(struct netfs_io_request *rreq, bool sync);

    +/*
    + * main.c
    + */
    +extern unsigned int netfs_debug;
    +
    /*
    * objects.c
    */
    diff --git a/fs/netfs/io.c b/fs/netfs/io.c
    index 1fe9706c58a5..4a3b7989cd1c 100644
    --- a/fs/netfs/io.c
    +++ b/fs/netfs/io.c
    @@ -15,16 +15,6 @@
    #include <linux/sched/mm.h>
    #include <linux/task_io_accounting_ops.h>
    #include "internal.h"
    -#define CREATE_TRACE_POINTS
    -#include <trace/events/netfs.h>
    -
    -MODULE_DESCRIPTION("Network fs support");
    -MODULE_AUTHOR("Red Hat, Inc.");
    -MODULE_LICENSE("GPL");
    -
    -unsigned netfs_debug;
    -module_param_named(debug, netfs_debug, uint, S_IWUSR | S_IRUGO);
    -MODULE_PARM_DESC(netfs_debug, "Netfs support debugging mask");

    /*
    * Clear the unread part of an I/O request.
    diff --git a/fs/netfs/main.c b/fs/netfs/main.c
    new file mode 100644
    index 000000000000..068568702957
    --- /dev/null
    +++ b/fs/netfs/main.c
    @@ -0,0 +1,20 @@
    +// SPDX-License-Identifier: GPL-2.0-or-later
    +/* Miscellaneous bits for the netfs support library.
    + *
    + * Copyright (C) 2022 Red Hat, Inc. All Rights Reserved.
    + * Written by David Howells (dhowells@redhat.com)
    + */
    +
    +#include <linux/module.h>
    +#include <linux/export.h>
    +#include "internal.h"
    +#define CREATE_TRACE_POINTS
    +#include <trace/events/netfs.h>
    +
    +MODULE_DESCRIPTION("Network fs support");
    +MODULE_AUTHOR("Red Hat, Inc.");
    +MODULE_LICENSE("GPL");
    +
    +unsigned netfs_debug;
    +module_param_named(debug, netfs_debug, uint, S_IWUSR | S_IRUGO);
    +MODULE_PARM_DESC(netfs_debug, "Netfs support debugging mask");

    \
     
     \ /
      Last update: 2022-03-09 02:04    [W:2.402 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site