diff options
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 61 |
1 files changed, 47 insertions, 14 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index a05b4a20768d..1ba3cf6edfbb 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -62,6 +62,12 @@ void reiserfs_write_unlock(struct super_block *s); | |||
62 | int reiserfs_write_lock_once(struct super_block *s); | 62 | int reiserfs_write_lock_once(struct super_block *s); |
63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | 63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); |
64 | 64 | ||
65 | #ifdef CONFIG_REISERFS_CHECK | ||
66 | void reiserfs_lock_check_recursive(struct super_block *s); | ||
67 | #else | ||
68 | static inline void reiserfs_lock_check_recursive(struct super_block *s) { } | ||
69 | #endif | ||
70 | |||
65 | /* | 71 | /* |
66 | * Several mutexes depend on the write lock. | 72 | * Several mutexes depend on the write lock. |
67 | * However sometimes we want to relax the write lock while we hold | 73 | * However sometimes we want to relax the write lock while we hold |
@@ -92,11 +98,31 @@ void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | |||
92 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, | 98 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, |
93 | struct super_block *s) | 99 | struct super_block *s) |
94 | { | 100 | { |
101 | reiserfs_lock_check_recursive(s); | ||
95 | reiserfs_write_unlock(s); | 102 | reiserfs_write_unlock(s); |
96 | mutex_lock(m); | 103 | mutex_lock(m); |
97 | reiserfs_write_lock(s); | 104 | reiserfs_write_lock(s); |
98 | } | 105 | } |
99 | 106 | ||
107 | static inline void | ||
108 | reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass, | ||
109 | struct super_block *s) | ||
110 | { | ||
111 | reiserfs_lock_check_recursive(s); | ||
112 | reiserfs_write_unlock(s); | ||
113 | mutex_lock_nested(m, subclass); | ||
114 | reiserfs_write_lock(s); | ||
115 | } | ||
116 | |||
117 | static inline void | ||
118 | reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s) | ||
119 | { | ||
120 | reiserfs_lock_check_recursive(s); | ||
121 | reiserfs_write_unlock(s); | ||
122 | down_read(sem); | ||
123 | reiserfs_write_lock(s); | ||
124 | } | ||
125 | |||
100 | /* | 126 | /* |
101 | * When we schedule, we usually want to also release the write lock, | 127 | * When we schedule, we usually want to also release the write lock, |
102 | * according to the previous bkl based locking scheme of reiserfs. | 128 | * according to the previous bkl based locking scheme of reiserfs. |
@@ -2051,25 +2077,12 @@ void set_de_name_and_namelen(struct reiserfs_dir_entry *de); | |||
2051 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, | 2077 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, |
2052 | struct treepath *path, struct reiserfs_dir_entry *de); | 2078 | struct treepath *path, struct reiserfs_dir_entry *de); |
2053 | struct dentry *reiserfs_get_parent(struct dentry *); | 2079 | struct dentry *reiserfs_get_parent(struct dentry *); |
2054 | /* procfs.c */ | ||
2055 | |||
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 | 2080 | ||
2081 | #ifdef CONFIG_REISERFS_PROC_INFO | ||
2062 | int reiserfs_proc_info_init(struct super_block *sb); | 2082 | int reiserfs_proc_info_init(struct super_block *sb); |
2063 | int reiserfs_proc_info_done(struct super_block *sb); | 2083 | int reiserfs_proc_info_done(struct super_block *sb); |
2064 | struct proc_dir_entry *reiserfs_proc_register_global(char *name, | ||
2065 | read_proc_t * func); | ||
2066 | void reiserfs_proc_unregister_global(const char *name); | ||
2067 | int reiserfs_proc_info_global_init(void); | 2084 | int reiserfs_proc_info_global_init(void); |
2068 | int reiserfs_proc_info_global_done(void); | 2085 | int reiserfs_proc_info_global_done(void); |
2069 | int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | ||
2070 | int count, int *eof, void *data); | ||
2071 | |||
2072 | #if defined( REISERFS_PROC_INFO ) | ||
2073 | 2086 | ||
2074 | #define PROC_EXP( e ) e | 2087 | #define PROC_EXP( e ) e |
2075 | 2088 | ||
@@ -2084,6 +2097,26 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | |||
2084 | PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \ | 2097 | PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \ |
2085 | PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) ) | 2098 | PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) ) |
2086 | #else | 2099 | #else |
2100 | static inline int reiserfs_proc_info_init(struct super_block *sb) | ||
2101 | { | ||
2102 | return 0; | ||
2103 | } | ||
2104 | |||
2105 | static inline int reiserfs_proc_info_done(struct super_block *sb) | ||
2106 | { | ||
2107 | return 0; | ||
2108 | } | ||
2109 | |||
2110 | static inline int reiserfs_proc_info_global_init(void) | ||
2111 | { | ||
2112 | return 0; | ||
2113 | } | ||
2114 | |||
2115 | static inline int reiserfs_proc_info_global_done(void) | ||
2116 | { | ||
2117 | return 0; | ||
2118 | } | ||
2119 | |||
2087 | #define PROC_EXP( e ) | 2120 | #define PROC_EXP( e ) |
2088 | #define VOID_V ( ( void ) 0 ) | 2121 | #define VOID_V ( ( void ) 0 ) |
2089 | #define PROC_INFO_MAX( sb, field, value ) VOID_V | 2122 | #define PROC_INFO_MAX( sb, field, value ) VOID_V |