Commit 9a468439 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] more sleep_on() removals

	Yet another flag/wait_queue pair bites the dust - hfs bitmap_{lock,wait}
was trying to implement a semaphore.
parent 62297add
...@@ -48,10 +48,7 @@ static inline void build_key(struct hfs_ext_key *key, ...@@ -48,10 +48,7 @@ static inline void build_key(struct hfs_ext_key *key,
* Get an exclusive lock on the B-tree bitmap. * Get an exclusive lock on the B-tree bitmap.
*/ */
static inline void lock_bitmap(struct hfs_mdb *mdb) { static inline void lock_bitmap(struct hfs_mdb *mdb) {
while (mdb->bitmap_lock) { down(&mdb->bitmap_sem);
hfs_sleep_on(&mdb->bitmap_wait);
}
mdb->bitmap_lock = 1;
} }
/* /*
...@@ -60,8 +57,7 @@ static inline void lock_bitmap(struct hfs_mdb *mdb) { ...@@ -60,8 +57,7 @@ static inline void lock_bitmap(struct hfs_mdb *mdb) {
* Relinquish an exclusive lock on the B-tree bitmap. * Relinquish an exclusive lock on the B-tree bitmap.
*/ */
static inline void unlock_bitmap(struct hfs_mdb *mdb) { static inline void unlock_bitmap(struct hfs_mdb *mdb) {
mdb->bitmap_lock = 0; up(&mdb->bitmap_sem);
hfs_wake_up(&mdb->bitmap_wait);
} }
/* /*
......
...@@ -271,8 +271,7 @@ struct hfs_mdb { ...@@ -271,8 +271,7 @@ struct hfs_mdb {
512-byte blocks per 512-byte blocks per
"allocation block" */ "allocation block" */
hfs_u16 attrib; /* Attribute word */ hfs_u16 attrib; /* Attribute word */
hfs_wait_queue bitmap_wait; struct semaphore bitmap_sem;
int bitmap_lock;
struct list_head entry_dirty; struct list_head entry_dirty;
}; };
......
...@@ -100,7 +100,7 @@ struct hfs_mdb *hfs_mdb_get(hfs_sysmdb sys_mdb, int readonly, ...@@ -100,7 +100,7 @@ struct hfs_mdb *hfs_mdb_get(hfs_sysmdb sys_mdb, int readonly,
mdb->magic = HFS_MDB_MAGIC; mdb->magic = HFS_MDB_MAGIC;
mdb->sys_mdb = sys_mdb; mdb->sys_mdb = sys_mdb;
INIT_LIST_HEAD(&mdb->entry_dirty); INIT_LIST_HEAD(&mdb->entry_dirty);
hfs_init_waitqueue(&mdb->bitmap_wait); init_MUTEX(&mdb->bitmap_sem);
/* See if this is an HFS filesystem */ /* See if this is an HFS filesystem */
buf = hfs_buffer_get(sys_mdb, part_start + HFS_MDB_BLK, 1); buf = hfs_buffer_get(sys_mdb, part_start + HFS_MDB_BLK, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment