]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: rename struct libxfs_xinit to libxfs_init
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Dec 2023 16:37:29 +0000 (17:37 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 18 Dec 2023 13:57:48 +0000 (14:57 +0100)
Make the struct name more usual, and remove the libxfs_init_t typedef.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
14 files changed:
copy/xfs_copy.c
db/init.c
db/init.h
growfs/xfs_growfs.c
include/libxfs.h
libxfs/init.c
libxfs/topology.c
libxfs/topology.h
logprint/logprint.c
mkfs/xfs_mkfs.c
repair/globals.h
repair/init.c
repair/protos.h
repair/sb.c

index 86187086db659d509793cb69747126b0678655ee..12ad81eb197e2502a4284657b8a8bc408d66d434 100644 (file)
@@ -582,7 +582,7 @@ main(int argc, char **argv)
        xfs_alloc_rec_t *rec_ptr;
        extern char     *optarg;
        extern int      optind;
-       libxfs_init_t   xargs;
+       struct libxfs_init xargs;
        thread_args     *tcarg;
        struct stat     statbuf;
        int             error;
index eceaf576cfb9eb95c08c75d3c23e5f5a9531d17b..36e2bb89d726bc636a5e6cebdd61353171887141 100644 (file)
--- a/db/init.c
+++ b/db/init.c
@@ -27,7 +27,7 @@ static struct xfs_mount       xmount;
 struct xfs_mount       *mp;
 static struct xlog     xlog;
 xfs_agnumber_t         cur_agno = NULLAGNUMBER;
-libxfs_init_t          x;
+struct libxfs_init     x;
 
 static void
 usage(void)
index 05e75c1007911480ddcd4129839c702cbcda5cbc..aa6d843d8d31ab36cf86029fc0c5cc0b65680212 100644 (file)
--- a/db/init.h
+++ b/db/init.h
@@ -8,5 +8,5 @@ extern int              blkbb;
 extern int             exitcode;
 extern int             expert_mode;
 extern xfs_mount_t     *mp;
-extern libxfs_init_t   x;
+extern struct libxfs_init x;
 extern xfs_agnumber_t  cur_agno;
index 683961f6b9cf522709ffc7a5656a2d6d46533afe..802e011545e258e1300e626a16898e928d9e8cc5 100644 (file)
@@ -61,7 +61,7 @@ main(int argc, char **argv)
        char                    *logdev;  /*  log device name */
        char                    *rtdev; /*   RT device name */
        fs_path_t               *fs;    /* mount point information */
-       libxfs_init_t           xi;     /* libxfs structure */
+       struct libxfs_init      xi;     /* libxfs structure */
        char                    rpath[PATH_MAX];
        int                     ret;
 
index 270efb2c18c202137ca4802cec8eafa4b11c1a88..6da8fd1c85756b0b869f6c299998c08d7f3b886c 100644 (file)
@@ -92,7 +92,7 @@ struct iomap;
 /*
  * Argument structure for libxfs_init().
  */
-typedef struct libxfs_xinit {
+struct libxfs_init {
                                /* input parameters */
        char            *dname;         /* pathname of data "subvolume" */
        char            *logname;       /* pathname of log "subvolume" */
@@ -123,7 +123,7 @@ typedef struct libxfs_xinit {
        int             logfd;          /* log subvolume file descriptor */
        int             rtfd;           /* realtime subvolume file descriptor */
        int             bcache_flags;   /* cache init flags */
-} libxfs_init_t;
+};
 
 #define LIBXFS_ISREADONLY      0x0002  /* disallow all mounted filesystems */
 #define LIBXFS_ISINACTIVE      0x0004  /* allow mounted only if mounted ro */
@@ -133,8 +133,10 @@ typedef struct libxfs_xinit {
 
 extern char    *progname;
 extern xfs_lsn_t libxfs_max_lsn;
-extern int     libxfs_init (libxfs_init_t *);
-void           libxfs_destroy(struct libxfs_xinit *li);
+
+int            libxfs_init(struct libxfs_init *);
+void           libxfs_destroy(struct libxfs_init *li);
+
 extern int     libxfs_device_to_fd (dev_t);
 extern dev_t   libxfs_device_open (char *, int, int, int);
 extern void    libxfs_device_close (dev_t);
index 6482ba52b2ad45bd8795fbf93a43a11810c162fb..cafd40b1121fddb56619f371834ddc676cc0445c 100644 (file)
@@ -273,7 +273,7 @@ destroy_caches(void)
 
 static void
 libxfs_close_devices(
-       struct libxfs_xinit     *li)
+       struct libxfs_init      *li)
 {
        if (li->ddev)
                libxfs_device_close(li->ddev);
@@ -291,7 +291,7 @@ libxfs_close_devices(
  * Caller gets a 0 on failure (and we print a message), 1 on success.
  */
 int
-libxfs_init(libxfs_init_t *a)
+libxfs_init(struct libxfs_init *a)
 {
        char            *dname;
        char            *logname;
@@ -1034,7 +1034,7 @@ libxfs_umount(
  */
 void
 libxfs_destroy(
-       struct libxfs_xinit     *li)
+       struct libxfs_init      *li)
 {
        int                     leaked;
 
index 25f47bedaf7887357412a2d750c73779d0c985bc..d6791c0f669b5e69c38f13d48679fde05bd8e7c5 100644 (file)
@@ -286,8 +286,9 @@ static void blkid_get_topology(
 
 #endif /* ENABLE_BLKID */
 
-void get_topology(
-       libxfs_init_t           *xi,
+void
+get_topology(
+       struct libxfs_init      *xi,
        struct fs_topology      *ft,
        int                     force_overwrite)
 {
index 1a0fe24c09d091ab0e2c90cd2633f9fabb5f10a4..1af5b054947daae90345fd38ce4d18d14ed8687e 100644 (file)
@@ -18,9 +18,9 @@ typedef struct fs_topology {
        int     psectorsize;    /* physical sector size */
 } fs_topology_t;
 
-extern void
+void
 get_topology(
-       libxfs_init_t           *xi,
+       struct libxfs_init      *xi,
        struct fs_topology      *ft,
        int                     force_overwrite);
 
index 1a096fa79987a4191cb4038c3be00b4ec4ab1c6f..c6e5051e8f8c4ece45e541e517b2903cc6fc84ed 100644 (file)
@@ -25,7 +25,7 @@ int   print_overwrite;
 int     print_no_data;
 int     print_no_print;
 static int     print_operation = OP_PRINT;
-static struct libxfs_xinit x;
+static struct libxfs_init x;
 
 static void
 usage(void)
index 19849ed21e86abdd8477826df76271ec604ad6b5..346516e13c51e4e11aa224aa5087ae94f7b735bb 100644 (file)
@@ -907,7 +907,7 @@ struct cli_params {
        struct fsxattr          fsx;
 
        /* libxfs device setup */
-       struct libxfs_xinit     *xi;
+       struct libxfs_init      *xi;
 };
 
 /*
@@ -1246,7 +1246,7 @@ validate_ag_geometry(
 
 static void
 zero_old_xfs_structures(
-       libxfs_init_t           *xi,
+       struct libxfs_init      *xi,
        xfs_sb_t                *new_sb)
 {
        void                    *buf;
@@ -2834,7 +2834,7 @@ _("log stripe unit (%d bytes) is too large (maximum is 256KiB)\n"
 static void
 open_devices(
        struct mkfs_params      *cfg,
-       struct libxfs_xinit     *xi)
+       struct libxfs_init      *xi)
 {
        uint64_t                sector_mask;
 
@@ -2867,7 +2867,7 @@ open_devices(
 
 static void
 discard_devices(
-       struct libxfs_xinit     *xi,
+       struct libxfs_init      *xi,
        int                     quiet)
 {
        /*
@@ -2887,7 +2887,7 @@ validate_datadev(
        struct mkfs_params      *cfg,
        struct cli_params       *cli)
 {
-       struct libxfs_xinit     *xi = cli->xi;
+       struct libxfs_init      *xi = cli->xi;
 
        if (!xi->dsize) {
                /*
@@ -2934,7 +2934,7 @@ validate_logdev(
        struct mkfs_params      *cfg,
        struct cli_params       *cli)
 {
-       struct libxfs_xinit     *xi = cli->xi;
+       struct libxfs_init      *xi = cli->xi;
 
        cfg->loginternal = cli->loginternal;
 
@@ -2998,7 +2998,7 @@ validate_rtdev(
        struct mkfs_params      *cfg,
        struct cli_params       *cli)
 {
-       struct libxfs_xinit     *xi = cli->xi;
+       struct libxfs_init      *xi = cli->xi;
 
        if (!xi->rtdev) {
                if (cli->rtsize) {
@@ -3750,7 +3750,7 @@ alloc_write_buf(
 static void
 prepare_devices(
        struct mkfs_params      *cfg,
-       struct libxfs_xinit     *xi,
+       struct libxfs_init      *xi,
        struct xfs_mount        *mp,
        struct xfs_sb           *sbp,
        bool                    clear_stale)
@@ -4055,7 +4055,7 @@ main(
        char                    *protostring = NULL;
        int                     worst_freelist = 0;
 
-       struct libxfs_xinit     xi = {
+       struct libxfs_init      xi = {
                .isdirect = LIBXFS_DIRECT,
                .isreadonly = LIBXFS_EXCLUSIVELY,
        };
index f2952d8b479491a9fe97d25b59ce317c8af6f78f..89f1b0e078f30356337e262f76bc0d4e7b9b1da1 100644 (file)
@@ -169,6 +169,6 @@ extern int          thread_count;
 /* If nonzero, simulate failure after this phase. */
 extern int             fail_after_phase;
 
-extern libxfs_init_t   x;
+extern struct libxfs_init x;
 
 #endif /* _XFS_REPAIR_GLOBAL_H */
index 6e3548b32ef8c9d66fac05f71687122699f71071..1c562fb34336dd178ae1f6f12501b8c61d1ed513 100644 (file)
@@ -18,7 +18,7 @@
 #include "libfrog/dahashselftest.h"
 #include <sys/resource.h>
 
-struct libxfs_xinit    x;
+struct libxfs_init     x;
 
 static void
 ts_create(void)
@@ -52,9 +52,9 @@ increase_rlimit(void)
 }
 
 void
-xfs_init(libxfs_init_t *args)
+xfs_init(struct libxfs_init *args)
 {
-       memset(args, 0, sizeof(libxfs_init_t));
+       memset(args, 0, sizeof(*args));
 
        args->dname = fs_name;
        args->disfile = isa_file;
index 83e471ff2ad1aa10fb2436570802409c5fb7da4f..e2f39f1d6e8aa307a414d1dcd0e60db1c1719ae4 100644 (file)
@@ -4,7 +4,7 @@
  * All Rights Reserved.
  */
 
-void   xfs_init(libxfs_init_t *args);
+void   xfs_init(struct libxfs_init *args);
 
 int    verify_sb(char                  *sb_buf,
                xfs_sb_t                *sb,
index 7391cf043fd0a3fab2959e28ecd7033fd448f3a6..b823ba3a9a4b5e63204b30d9ad47bbbf5f6caed8 100644 (file)
@@ -176,7 +176,7 @@ static int
 guess_default_geometry(
        uint64_t                *agsize,
        uint64_t                *agcount,
-       libxfs_init_t           *x)
+       struct libxfs_init      *x)
 {
        struct fs_topology      ft;
        int                     blocklog;