Skip to content

Commit b6cfbec

Browse files
dhowellsAl Viro
authored andcommitted
afs: Handle CONFIG_PROC_FS=n
The AFS filesystem depends at the moment on /proc for configuration and also presents information that way - however, this causes a compilation failure if procfs is disabled. Fix it so that the procfs bits aren't compiled in if procfs is disabled. This means that you can't configure the AFS filesystem directly, but it is still usable provided that an up-to-date keyutils is installed to look up cells by SRV or AFSDB DNS records. Reported-by: Al Viro <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent 24074a3 commit b6cfbec

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

fs/afs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
afs-cache-$(CONFIG_AFS_FSCACHE) := cache.o
77

8-
kafs-objs := \
8+
kafs-y := \
99
$(afs-cache-y) \
1010
addr_list.o \
1111
callback.o \
@@ -21,7 +21,6 @@ kafs-objs := \
2121
main.o \
2222
misc.o \
2323
mntpt.o \
24-
proc.o \
2524
rotate.o \
2625
rxrpc.o \
2726
security.o \
@@ -34,4 +33,5 @@ kafs-objs := \
3433
write.o \
3534
xattr.o
3635

36+
kafs-$(CONFIG_PROC_FS) += proc.o
3737
obj-$(CONFIG_AFS_FS) := kafs.o

fs/afs/internal.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,11 +871,19 @@ extern int afs_get_ipv4_interfaces(struct afs_net *, struct afs_interface *,
871871
/*
872872
* proc.c
873873
*/
874+
#ifdef CONFIG_PROC_FS
874875
extern int __net_init afs_proc_init(struct afs_net *);
875876
extern void __net_exit afs_proc_cleanup(struct afs_net *);
876877
extern int afs_proc_cell_setup(struct afs_cell *);
877878
extern void afs_proc_cell_remove(struct afs_cell *);
878879
extern void afs_put_sysnames(struct afs_sysnames *);
880+
#else
881+
static inline int afs_proc_init(struct afs_net *net) { return 0; }
882+
static inline void afs_proc_cleanup(struct afs_net *net) {}
883+
static inline int afs_proc_cell_setup(struct afs_cell *cell) { return 0; }
884+
static inline void afs_proc_cell_remove(struct afs_cell *cell) {}
885+
static inline void afs_put_sysnames(struct afs_sysnames *sysnames) {}
886+
#endif
879887

880888
/*
881889
* rotate.c

0 commit comments

Comments
 (0)