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,
* Get an exclusive lock on the B-tree bitmap.
*/
static inline void lock_bitmap(struct hfs_mdb *mdb) {
while (mdb->bitmap_lock) {
hfs_sleep_on(&mdb->bitmap_wait);
}
mdb->bitmap_lock = 1;
down(&mdb->bitmap_sem);
}
/*
......@@ -60,8 +57,7 @@ static inline void lock_bitmap(struct hfs_mdb *mdb) {
* Relinquish an exclusive lock on the B-tree bitmap.
*/
static inline void unlock_bitmap(struct hfs_mdb *mdb) {
mdb->bitmap_lock = 0;
hfs_wake_up(&mdb->bitmap_wait);
up(&mdb->bitmap_sem);
}
/*
......
......@@ -271,8 +271,7 @@ struct hfs_mdb {
512-byte blocks per
"allocation block" */
hfs_u16 attrib; /* Attribute word */
hfs_wait_queue bitmap_wait;
int bitmap_lock;
struct semaphore bitmap_sem;
struct list_head entry_dirty;
};
......
......@@ -100,7 +100,7 @@ struct hfs_mdb *hfs_mdb_get(hfs_sysmdb sys_mdb, int readonly,
mdb->magic = HFS_MDB_MAGIC;
mdb->sys_mdb = sys_mdb;
INIT_LIST_HEAD(&mdb->entry_dirty);
hfs_init_waitqueue(&mdb->bitmap_wait);
init_MUTEX(&mdb->bitmap_sem);
/* See if this is an HFS filesystem */
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