Commit e3c96f53ac132743fda1384910feb863a2eab916
Committed by
Linus Torvalds
1 parent
904e812931
Exists in
master
and in
4 other branches
reiserfs: don't compile procfs.o at all if no support
* small define cleanup in header * fix #ifdeffery in procfs.c via Kconfig Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 3 changed files with 26 additions and 36 deletions Side-by-side Diff
fs/reiserfs/Makefile
... | ... | @@ -7,7 +7,11 @@ |
7 | 7 | reiserfs-objs := bitmap.o do_balan.o namei.o inode.o file.o dir.o fix_node.o \ |
8 | 8 | super.o prints.o objectid.o lbalance.o ibalance.o stree.o \ |
9 | 9 | hashes.o tail_conversion.o journal.o resize.o \ |
10 | - item_ops.o ioctl.o procfs.o xattr.o lock.o | |
10 | + item_ops.o ioctl.o xattr.o lock.o | |
11 | + | |
12 | +ifeq ($(CONFIG_REISERFS_PROC_INFO),y) | |
13 | +reiserfs-objs += procfs.o | |
14 | +endif | |
11 | 15 | |
12 | 16 | ifeq ($(CONFIG_REISERFS_FS_XATTR),y) |
13 | 17 | reiserfs-objs += xattr_user.o xattr_trusted.o |
fs/reiserfs/procfs.c
... | ... | @@ -17,8 +17,6 @@ |
17 | 17 | #include <linux/init.h> |
18 | 18 | #include <linux/proc_fs.h> |
19 | 19 | |
20 | -#ifdef CONFIG_REISERFS_PROC_INFO | |
21 | - | |
22 | 20 | /* |
23 | 21 | * LOCKING: |
24 | 22 | * |
... | ... | @@ -551,30 +549,6 @@ |
551 | 549 | } |
552 | 550 | return 0; |
553 | 551 | } |
554 | - | |
555 | -/* REISERFS_PROC_INFO */ | |
556 | -#else | |
557 | - | |
558 | -int reiserfs_proc_info_init(struct super_block *sb) | |
559 | -{ | |
560 | - return 0; | |
561 | -} | |
562 | -int reiserfs_proc_info_done(struct super_block *sb) | |
563 | -{ | |
564 | - return 0; | |
565 | -} | |
566 | - | |
567 | -int reiserfs_proc_info_global_init(void) | |
568 | -{ | |
569 | - return 0; | |
570 | -} | |
571 | -int reiserfs_proc_info_global_done(void) | |
572 | -{ | |
573 | - return 0; | |
574 | -} | |
575 | -/* REISERFS_PROC_INFO */ | |
576 | -#endif | |
577 | - | |
578 | 552 | /* |
579 | 553 | * Revision 1.1.8.2 2001/07/15 17:08:42 god |
580 | 554 | * . use get_super() in procfs.c |
include/linux/reiserfs_fs.h
... | ... | @@ -2051,21 +2051,13 @@ |
2051 | 2051 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, |
2052 | 2052 | struct treepath *path, struct reiserfs_dir_entry *de); |
2053 | 2053 | struct dentry *reiserfs_get_parent(struct dentry *); |
2054 | -/* procfs.c */ | |
2055 | 2054 | |
2056 | -#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO ) | |
2057 | -#define REISERFS_PROC_INFO | |
2058 | -#else | |
2059 | -#undef REISERFS_PROC_INFO | |
2060 | -#endif | |
2061 | - | |
2055 | +#ifdef CONFIG_REISERFS_PROC_INFO | |
2062 | 2056 | int reiserfs_proc_info_init(struct super_block *sb); |
2063 | 2057 | int reiserfs_proc_info_done(struct super_block *sb); |
2064 | 2058 | int reiserfs_proc_info_global_init(void); |
2065 | 2059 | int reiserfs_proc_info_global_done(void); |
2066 | 2060 | |
2067 | -#if defined( REISERFS_PROC_INFO ) | |
2068 | - | |
2069 | 2061 | #define PROC_EXP( e ) e |
2070 | 2062 | |
2071 | 2063 | #define __PINFO( sb ) REISERFS_SB(sb) -> s_proc_info_data |
... | ... | @@ -2079,6 +2071,26 @@ |
2079 | 2071 | PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \ |
2080 | 2072 | PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) ) |
2081 | 2073 | #else |
2074 | +static inline int reiserfs_proc_info_init(struct super_block *sb) | |
2075 | +{ | |
2076 | + return 0; | |
2077 | +} | |
2078 | + | |
2079 | +static inline int reiserfs_proc_info_done(struct super_block *sb) | |
2080 | +{ | |
2081 | + return 0; | |
2082 | +} | |
2083 | + | |
2084 | +static inline int reiserfs_proc_info_global_init(void) | |
2085 | +{ | |
2086 | + return 0; | |
2087 | +} | |
2088 | + | |
2089 | +static inline int reiserfs_proc_info_global_done(void) | |
2090 | +{ | |
2091 | + return 0; | |
2092 | +} | |
2093 | + | |
2082 | 2094 | #define PROC_EXP( e ) |
2083 | 2095 | #define VOID_V ( ( void ) 0 ) |
2084 | 2096 | #define PROC_INFO_MAX( sb, field, value ) VOID_V |