diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3ae8e37bdfc8..047bde30836a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -213,6 +213,7 @@ extern int dir_notify_enable; | |||
213 | #include <linux/radix-tree.h> | 213 | #include <linux/radix-tree.h> |
214 | #include <linux/prio_tree.h> | 214 | #include <linux/prio_tree.h> |
215 | #include <linux/init.h> | 215 | #include <linux/init.h> |
216 | #include <linux/sched.h> | ||
216 | 217 | ||
217 | #include <asm/atomic.h> | 218 | #include <asm/atomic.h> |
218 | #include <asm/semaphore.h> | 219 | #include <asm/semaphore.h> |
@@ -822,16 +823,34 @@ enum { | |||
822 | #define vfs_check_frozen(sb, level) \ | 823 | #define vfs_check_frozen(sb, level) \ |
823 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) | 824 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) |
824 | 825 | ||
826 | static inline void get_fs_excl(void) | ||
827 | { | ||
828 | atomic_inc(¤t->fs_excl); | ||
829 | } | ||
830 | |||
831 | static inline void put_fs_excl(void) | ||
832 | { | ||
833 | atomic_dec(¤t->fs_excl); | ||
834 | } | ||
835 | |||
836 | static inline int has_fs_excl(void) | ||
837 | { | ||
838 | return atomic_read(¤t->fs_excl); | ||
839 | } | ||
840 | |||
841 | |||
825 | /* | 842 | /* |
826 | * Superblock locking. | 843 | * Superblock locking. |
827 | */ | 844 | */ |
828 | static inline void lock_super(struct super_block * sb) | 845 | static inline void lock_super(struct super_block * sb) |
829 | { | 846 | { |
847 | get_fs_excl(); | ||
830 | down(&sb->s_lock); | 848 | down(&sb->s_lock); |
831 | } | 849 | } |
832 | 850 | ||
833 | static inline void unlock_super(struct super_block * sb) | 851 | static inline void unlock_super(struct super_block * sb) |
834 | { | 852 | { |
853 | put_fs_excl(); | ||
835 | up(&sb->s_lock); | 854 | up(&sb->s_lock); |
836 | } | 855 | } |
837 | 856 | ||