aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/ufs.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-01-24 04:14:12 -0500
committerArnd Bergmann <arnd@arndb.de>2011-03-02 16:27:48 -0500
commit788257d6101d986ac8f2741aaa35974af47f574c (patch)
tree332d877e09d8b5de6a4bdfba8111dd04e84a722b /fs/ufs/ufs.h
parent9a311b96c3065f362e3348cb5d7af1a57ca6bff9 (diff)
ufs: remove the BKL
This introduces a new per-superblock mutex in UFS to replace the big kernel lock. I have been careful to avoid nested calls to lock_ufs and to get the lock order right with respect to other mutexes, in particular lock_super. I did not make any attempt to prove that the big kernel lock is not needed in a particular place in the code, which is very possible. The mutex has a significant performance impact, so it is only used on SMP or PREEMPT configurations. As Nick Piggin noticed, any allocation inside of the lock may end up deadlocking when we get to ufs_getfrag_block in the reclaim task, so we now use GFP_NOFS. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Nick Bowler <nbowler@elliptictech.com> Cc: Evgeniy Dushistov <dushistov@mail.ru> Cc: Nick Piggin <npiggin@gmail.com>
Diffstat (limited to 'fs/ufs/ufs.h')
-rw-r--r--fs/ufs/ufs.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h
index c08782e1b48..5be2755dd71 100644
--- a/fs/ufs/ufs.h
+++ b/fs/ufs/ufs.h
@@ -18,6 +18,8 @@ struct ufs_sb_info {
18 unsigned s_cgno[UFS_MAX_GROUP_LOADED]; 18 unsigned s_cgno[UFS_MAX_GROUP_LOADED];
19 unsigned short s_cg_loaded; 19 unsigned short s_cg_loaded;
20 unsigned s_mount_opt; 20 unsigned s_mount_opt;
21 struct mutex mutex;
22 struct task_struct *mutex_owner;
21}; 23};
22 24
23struct ufs_inode_info { 25struct ufs_inode_info {
@@ -109,7 +111,6 @@ extern struct inode *ufs_iget(struct super_block *, unsigned long);
109extern int ufs_write_inode (struct inode *, struct writeback_control *); 111extern int ufs_write_inode (struct inode *, struct writeback_control *);
110extern int ufs_sync_inode (struct inode *); 112extern int ufs_sync_inode (struct inode *);
111extern void ufs_evict_inode (struct inode *); 113extern void ufs_evict_inode (struct inode *);
112extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
113extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); 114extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
114 115
115/* namei.c */ 116/* namei.c */
@@ -154,4 +155,7 @@ static inline u32 ufs_dtogd(struct ufs_sb_private_info * uspi, u64 b)
154 return do_div(b, uspi->s_fpg); 155 return do_div(b, uspi->s_fpg);
155} 156}
156 157
158extern void lock_ufs(struct super_block *sb);
159extern void unlock_ufs(struct super_block *sb);
160
157#endif /* _UFS_UFS_H */ 161#endif /* _UFS_UFS_H */