Skip to content

Commit 0db6611

Browse files
robntonyhutter
authored andcommitted
Linux 6.8 compat: make test functions static
The kernel is now being compiled with -Wmissing-prototypes. Most of our test stub functions had no prototype, and failed to compile. Since they don't need to be visible anywhere else, just make them all static. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15805 (cherry picked from commit 64afc4e)
1 parent 71d407c commit 0db6611

32 files changed

+91
-94
lines changed

config/kernel-acl.m4

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
172172
ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
173173
#include <linux/fs.h>
174174
175-
struct posix_acl *get_acl_fn(struct inode *inode, int type)
175+
static struct posix_acl *get_acl_fn(struct inode *inode, int type)
176176
{ return NULL; }
177177
178178
static const struct inode_operations
@@ -184,7 +184,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
184184
ZFS_LINUX_TEST_SRC([inode_operations_get_acl_rcu], [
185185
#include <linux/fs.h>
186186
187-
struct posix_acl *get_acl_fn(struct inode *inode, int type,
187+
static struct posix_acl *get_acl_fn(struct inode *inode, int type,
188188
bool rcu) { return NULL; }
189189
190190
static const struct inode_operations
@@ -196,7 +196,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
196196
ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [
197197
#include <linux/fs.h>
198198
199-
struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
199+
static struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
200200
bool rcu) { return NULL; }
201201
202202
static const struct inode_operations
@@ -243,7 +243,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
243243
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_mnt_idmap_dentry], [
244244
#include <linux/fs.h>
245245
246-
int set_acl_fn(struct mnt_idmap *idmap,
246+
static int set_acl_fn(struct mnt_idmap *idmap,
247247
struct dentry *dent, struct posix_acl *acl,
248248
int type) { return 0; }
249249
@@ -255,7 +255,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
255255
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns_dentry], [
256256
#include <linux/fs.h>
257257
258-
int set_acl_fn(struct user_namespace *userns,
258+
static int set_acl_fn(struct user_namespace *userns,
259259
struct dentry *dent, struct posix_acl *acl,
260260
int type) { return 0; }
261261
@@ -267,7 +267,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
267267
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
268268
#include <linux/fs.h>
269269
270-
int set_acl_fn(struct user_namespace *userns,
270+
static int set_acl_fn(struct user_namespace *userns,
271271
struct inode *inode, struct posix_acl *acl,
272272
int type) { return 0; }
273273
@@ -279,7 +279,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
279279
ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
280280
#include <linux/fs.h>
281281
282-
int set_acl_fn(struct inode *inode, struct posix_acl *acl,
282+
static int set_acl_fn(struct inode *inode, struct posix_acl *acl,
283283
int type) { return 0; }
284284
285285
static const struct inode_operations

config/kernel-automount.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dnl #
88
AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
99
ZFS_LINUX_TEST_SRC([dentry_operations_d_automount], [
1010
#include <linux/dcache.h>
11-
struct vfsmount *d_automount(struct path *p) { return NULL; }
11+
static struct vfsmount *d_automount(struct path *p) { return NULL; }
1212
struct dentry_operations dops __attribute__ ((unused)) = {
1313
.d_automount = d_automount,
1414
};

config/kernel-bio.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ dnl #
247247
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS], [
248248
ZFS_LINUX_TEST_SRC([bio_end_io_t_args], [
249249
#include <linux/bio.h>
250-
void wanted_end_io(struct bio *bio) { return; }
250+
static void wanted_end_io(struct bio *bio) { return; }
251251
bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
252252
], [])
253253
])

config/kernel-block-device-operations.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
55
ZFS_LINUX_TEST_SRC([block_device_operations_check_events], [
66
#include <linux/blkdev.h>
77
8-
unsigned int blk_check_events(struct gendisk *disk,
8+
static unsigned int blk_check_events(struct gendisk *disk,
99
unsigned int clearing) {
1010
(void) disk, (void) clearing;
1111
return (0);
@@ -34,7 +34,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
3434
ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [
3535
#include <linux/blkdev.h>
3636
37-
void blk_release(struct gendisk *g, fmode_t mode) {
37+
static void blk_release(struct gendisk *g, fmode_t mode) {
3838
(void) g, (void) mode;
3939
return;
4040
}
@@ -56,7 +56,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG], [
5656
ZFS_LINUX_TEST_SRC([block_device_operations_release_void_1arg], [
5757
#include <linux/blkdev.h>
5858
59-
void blk_release(struct gendisk *g) {
59+
static void blk_release(struct gendisk *g) {
6060
(void) g;
6161
return;
6262
}
@@ -96,7 +96,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
9696
ZFS_LINUX_TEST_SRC([block_device_operations_revalidate_disk], [
9797
#include <linux/blkdev.h>
9898
99-
int blk_revalidate_disk(struct gendisk *disk) {
99+
static int blk_revalidate_disk(struct gendisk *disk) {
100100
(void) disk;
101101
return(0);
102102
}

config/kernel-commit-metadata.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dnl #
77
AC_DEFUN([ZFS_AC_KERNEL_SRC_COMMIT_METADATA], [
88
ZFS_LINUX_TEST_SRC([export_operations_commit_metadata], [
99
#include <linux/exportfs.h>
10-
int commit_metadata(struct inode *inode) { return 0; }
10+
static int commit_metadata(struct inode *inode) { return 0; }
1111
static struct export_operations eops __attribute__ ((unused))={
1212
.commit_metadata = commit_metadata,
1313
};

config/kernel-dentry-operations.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA], [
9898
#include <linux/dcache.h>
9999
#include <linux/sched.h>
100100
101-
int revalidate (struct dentry *dentry,
101+
static int revalidate (struct dentry *dentry,
102102
struct nameidata *nidata) { return 0; }
103103
104104
static const struct dentry_operations

config/kernel-dirty-inode.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_DIRTY_INODE], [
88
ZFS_LINUX_TEST_SRC([dirty_inode_with_flags], [
99
#include <linux/fs.h>
1010
11-
void dirty_inode(struct inode *a, int b) { return; }
11+
static void dirty_inode(struct inode *a, int b) { return; }
1212
1313
static const struct super_operations
1414
sops __attribute__ ((unused)) = {

config/kernel-encode-fh-inode.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dnl #
77
AC_DEFUN([ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE], [
88
ZFS_LINUX_TEST_SRC([export_operations_encode_fh], [
99
#include <linux/exportfs.h>
10-
int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
10+
static int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
1111
struct inode *parent) { return 0; }
1212
static struct export_operations eops __attribute__ ((unused))={
1313
.encode_fh = encode_fh,

config/kernel-evict-inode.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dnl #
66
AC_DEFUN([ZFS_AC_KERNEL_SRC_EVICT_INODE], [
77
ZFS_LINUX_TEST_SRC([evict_inode], [
88
#include <linux/fs.h>
9-
void evict_inode (struct inode * t) { return; }
9+
static void evict_inode (struct inode * t) { return; }
1010
static struct super_operations sops __attribute__ ((unused)) = {
1111
.evict_inode = evict_inode,
1212
};

config/kernel-fallocate.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
1111
ZFS_LINUX_TEST_SRC([file_fallocate], [
1212
#include <linux/fs.h>
1313
14-
long test_fallocate(struct file *file, int mode,
14+
static long test_fallocate(struct file *file, int mode,
1515
loff_t offset, loff_t len) { return 0; }
1616
1717
static const struct file_operations

0 commit comments

Comments
 (0)