]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: move file_class variants after their constructors
authorMasatake YAMATO <yamato@redhat.com>
Thu, 6 May 2021 14:34:51 +0000 (23:34 +0900)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Oct 2021 09:01:53 +0000 (11:01 +0200)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd-bdev.c
misc-utils/lsfd-cdev.c
misc-utils/lsfd-sock.c
misc-utils/lsfd-unkn.c

index ce900dd5e05b5463af091453123fcad9fd3ea899..e40c0c739cfe8918d014ef4075be17a3bd5d1ddd 100644 (file)
@@ -53,16 +53,16 @@ static bool bdev_fill_column(struct proc *proc __attribute__((__unused__)),
        return true;
 }
 
-const struct file_class bdev_class = {
-       .super = &file_class,
-       .size = sizeof(struct file),
-       .fill_column = bdev_fill_column,
-       .free_content = NULL,
-};
-
 struct file *make_bdev(const struct file_class *class,
                       struct stat *sb, const char *name, int fd)
 {
        return make_file(class? class: &bdev_class,
                         sb, name, fd);
 }
+
+const struct file_class bdev_class = {
+       .super = &file_class,
+       .size = sizeof(struct file),
+       .fill_column = bdev_fill_column,
+       .free_content = NULL,
+};
index 98c83ca337d3d191be871c624ab398eb769f9b5f..c31c3a8fad2d34d3aa7eb3ca992113b57a2fcbba 100644 (file)
@@ -53,16 +53,16 @@ static bool cdev_fill_column(struct proc *proc __attribute__((__unused__)),
        return true;
 }
 
-const struct file_class cdev_class = {
-       .super = &file_class,
-       .size = sizeof(struct file),
-       .fill_column = cdev_fill_column,
-       .free_content = NULL,
-};
-
 struct file *make_cdev(const struct file_class *class,
                       struct stat *sb, const char *name, int fd)
 {
        return make_file(class? class: &cdev_class,
                         sb, name, fd);
 }
+
+const struct file_class cdev_class = {
+       .super = &file_class,
+       .size = sizeof(struct file),
+       .fill_column = cdev_fill_column,
+       .free_content = NULL,
+};
index 28b561bfbe14359b1d793802b1734ad13b748efc..937db04d81737991acccf01afffa542b568dff91 100644 (file)
@@ -41,16 +41,16 @@ static bool sock_fill_column(struct proc *proc __attribute__((__unused__)),
        }
 }
 
-const struct file_class sock_class = {
-       .super = &file_class,
-       .size = sizeof(struct file),
-       .fill_column = sock_fill_column,
-       .free_content = NULL,
-};
-
 struct file *make_sock(const struct file_class *class,
                       struct stat *sb, const char *name, int fd)
 {
        return make_file(class? class: &sock_class,
                         sb, name, fd);
 }
+
+const struct file_class sock_class = {
+       .super = &file_class,
+       .size = sizeof(struct file),
+       .fill_column = sock_fill_column,
+       .free_content = NULL,
+};
index f736324b99dfe95af919002f7b59072b3affed1e..af77cc46a5350126a3284ab5e41a13fb870e8073 100644 (file)
@@ -41,16 +41,16 @@ static bool unkn_fill_column(struct proc *proc __attribute__((__unused__)),
        }
 }
 
-const struct file_class unkn_class = {
-       .super = &file_class,
-       .size = sizeof(struct file),
-       .fill_column = unkn_fill_column,
-       .free_content = NULL,
-};
-
 struct file *make_unkn(const struct file_class *class,
                       struct stat *sb, const char *name, int fd)
 {
        return make_file(class? class: &unkn_class,
                         sb, name, fd);
 }
+
+const struct file_class unkn_class = {
+       .super = &file_class,
+       .size = sizeof(struct file),
+       .fill_column = unkn_fill_column,
+       .free_content = NULL,
+};