Skip to content

Commit 8e5ac43

Browse files
robnlundman
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 openzfs#15805
1 parent a2c8f91 commit 8e5ac43

33 files changed

+95
-98
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

config/kernel-fsync.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [
55
ZFS_LINUX_TEST_SRC([fsync_without_dentry], [
66
#include <linux/fs.h>
77
8-
int test_fsync(struct file *f, int x) { return 0; }
8+
static int test_fsync(struct file *f, int x) { return 0; }
99
1010
static const struct file_operations
1111
fops __attribute__ ((unused)) = {
@@ -16,7 +16,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [
1616
ZFS_LINUX_TEST_SRC([fsync_range], [
1717
#include <linux/fs.h>
1818
19-
int test_fsync(struct file *f, loff_t a, loff_t b, int c)
19+
static int test_fsync(struct file *f, loff_t a, loff_t b, int c)
2020
{ return 0; }
2121
2222
static const struct file_operations

config/kernel-get-link.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dnl #
55
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
66
ZFS_LINUX_TEST_SRC([inode_operations_get_link], [
77
#include <linux/fs.h>
8-
const char *get_link(struct dentry *de, struct inode *ip,
8+
static const char *get_link(struct dentry *de, struct inode *ip,
99
struct delayed_call *done) { return "symlink"; }
1010
static struct inode_operations
1111
iops __attribute__ ((unused)) = {
@@ -15,7 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
1515
1616
ZFS_LINUX_TEST_SRC([inode_operations_get_link_cookie], [
1717
#include <linux/fs.h>
18-
const char *get_link(struct dentry *de, struct
18+
static const char *get_link(struct dentry *de, struct
1919
inode *ip, void **cookie) { return "symlink"; }
2020
static struct inode_operations
2121
iops __attribute__ ((unused)) = {
@@ -25,7 +25,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
2525
2626
ZFS_LINUX_TEST_SRC([inode_operations_follow_link], [
2727
#include <linux/fs.h>
28-
const char *follow_link(struct dentry *de,
28+
static const char *follow_link(struct dentry *de,
2929
void **cookie) { return "symlink"; }
3030
static struct inode_operations
3131
iops __attribute__ ((unused)) = {
@@ -35,7 +35,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
3535
3636
ZFS_LINUX_TEST_SRC([inode_operations_follow_link_nameidata], [
3737
#include <linux/fs.h>
38-
void *follow_link(struct dentry *de, struct
38+
static void *follow_link(struct dentry *de, struct
3939
nameidata *nd) { return (void *)NULL; }
4040
static struct inode_operations
4141
iops __attribute__ ((unused)) = {

config/kernel-inode-create.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [
77
#include <linux/fs.h>
88
#include <linux/sched.h>
99
10-
int inode_create(struct mnt_idmap *idmap,
10+
static int inode_create(struct mnt_idmap *idmap,
1111
struct inode *inode ,struct dentry *dentry,
1212
umode_t umode, bool flag) { return 0; }
1313
@@ -25,7 +25,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [
2525
#include <linux/fs.h>
2626
#include <linux/sched.h>
2727
28-
int inode_create(struct user_namespace *userns,
28+
static int inode_create(struct user_namespace *userns,
2929
struct inode *inode ,struct dentry *dentry,
3030
umode_t umode, bool flag) { return 0; }
3131
@@ -42,7 +42,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [
4242
#include <linux/fs.h>
4343
#include <linux/sched.h>
4444
45-
int inode_create(struct inode *inode ,struct dentry *dentry,
45+
static int inode_create(struct inode *inode ,struct dentry *dentry,
4646
umode_t umode, bool flag) { return 0; }
4747
4848
static const struct inode_operations

config/kernel-inode-getattr.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
77
ZFS_LINUX_TEST_SRC([inode_operations_getattr_mnt_idmap], [
88
#include <linux/fs.h>
99
10-
int test_getattr(
10+
static int test_getattr(
1111
struct mnt_idmap *idmap,
1212
const struct path *p, struct kstat *k,
1313
u32 request_mask, unsigned int query_flags)
@@ -28,7 +28,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
2828
ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [
2929
#include <linux/fs.h>
3030
31-
int test_getattr(
31+
static int test_getattr(
3232
struct user_namespace *userns,
3333
const struct path *p, struct kstat *k,
3434
u32 request_mask, unsigned int query_flags)
@@ -47,7 +47,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
4747
ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
4848
#include <linux/fs.h>
4949
50-
int test_getattr(
50+
static int test_getattr(
5151
const struct path *p, struct kstat *k,
5252
u32 request_mask, unsigned int query_flags)
5353
{ return 0; }
@@ -61,7 +61,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
6161
ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
6262
#include <linux/fs.h>
6363
64-
int test_getattr(
64+
static int test_getattr(
6565
struct vfsmount *mnt, struct dentry *d,
6666
struct kstat *k)
6767
{ return 0; }

config/kernel-inode-lookup.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS], [
66
#include <linux/fs.h>
77
#include <linux/sched.h>
88
9-
struct dentry *inode_lookup(struct inode *inode,
9+
static struct dentry *inode_lookup(struct inode *inode,
1010
struct dentry *dentry, unsigned int flags) { return NULL; }
1111
1212
static const struct inode_operations iops

config/kernel-inode-permission.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_PERMISSION], [
88
#include <linux/fs.h>
99
#include <linux/sched.h>
1010
11-
int inode_permission(struct mnt_idmap *idmap,
11+
static int inode_permission(struct mnt_idmap *idmap,
1212
struct inode *inode, int mask) { return 0; }
1313
1414
static const struct inode_operations
@@ -25,7 +25,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_PERMISSION], [
2525
#include <linux/fs.h>
2626
#include <linux/sched.h>
2727
28-
int inode_permission(struct user_namespace *userns,
28+
static int inode_permission(struct user_namespace *userns,
2929
struct inode *inode, int mask) { return 0; }
3030
3131
static const struct inode_operations

config/kernel-inode-setattr.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SETATTR], [
77
ZFS_LINUX_TEST_SRC([inode_operations_setattr_mnt_idmap], [
88
#include <linux/fs.h>
99
10-
int test_setattr(
10+
static int test_setattr(
1111
struct mnt_idmap *idmap,
1212
struct dentry *de, struct iattr *ia)
1313
{ return 0; }
@@ -27,7 +27,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SETATTR], [
2727
ZFS_LINUX_TEST_SRC([inode_operations_setattr_userns], [
2828
#include <linux/fs.h>
2929
30-
int test_setattr(
30+
static int test_setattr(
3131
struct user_namespace *userns,
3232
struct dentry *de, struct iattr *ia)
3333
{ return 0; }
@@ -41,7 +41,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SETATTR], [
4141
ZFS_LINUX_TEST_SRC([inode_operations_setattr], [
4242
#include <linux/fs.h>
4343
44-
int test_setattr(
44+
static int test_setattr(
4545
struct dentry *de, struct iattr *ia)
4646
{ return 0; }
4747

config/kernel-make-request-fn.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ dnl #
44
AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
55
ZFS_LINUX_TEST_SRC([make_request_fn_void], [
66
#include <linux/blkdev.h>
7-
void make_request(struct request_queue *q,
7+
static void make_request(struct request_queue *q,
88
struct bio *bio) { return; }
99
],[
1010
blk_queue_make_request(NULL, &make_request);
1111
])
1212
1313
ZFS_LINUX_TEST_SRC([make_request_fn_blk_qc_t], [
1414
#include <linux/blkdev.h>
15-
blk_qc_t make_request(struct request_queue *q,
15+
static blk_qc_t make_request(struct request_queue *q,
1616
struct bio *bio) { return (BLK_QC_T_NONE); }
1717
],[
1818
blk_queue_make_request(NULL, &make_request);
1919
])
2020
2121
ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn], [
2222
#include <linux/blkdev.h>
23-
blk_qc_t make_request(struct request_queue *q,
23+
static blk_qc_t make_request(struct request_queue *q,
2424
struct bio *bio) { return (BLK_QC_T_NONE); }
2525
],[
2626
struct request_queue *q __attribute__ ((unused));
@@ -29,7 +29,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
2929
3030
ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [
3131
#include <linux/blkdev.h>
32-
blk_qc_t make_request(struct request_queue *q,
32+
static blk_qc_t make_request(struct request_queue *q,
3333
struct bio *bio) { return (BLK_QC_T_NONE); }
3434
],[
3535
struct request_queue *q __attribute__ ((unused));

0 commit comments

Comments
 (0)