Commit 6ccadfbb authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] hpfs cleanup (switch from sleep_on() to semaphore)

	Pair (flag, wait_queue) in hpfs replaced with semaphore.
parent 3ffa0b66
......@@ -14,8 +14,7 @@ void hpfs_lock_creation(struct super_block *s)
#ifdef DEBUG_LOCKS
printk("lock creation\n");
#endif
while (s->s_hpfs_creation_de_lock) sleep_on(&s->s_hpfs_creation_de);
s->s_hpfs_creation_de_lock = 1;
down(&s->u.hpfs_sb.hpfs_creation_de);
}
void hpfs_unlock_creation(struct super_block *s)
......@@ -23,8 +22,7 @@ void hpfs_unlock_creation(struct super_block *s)
#ifdef DEBUG_LOCKS
printk("unlock creation\n");
#endif
s->s_hpfs_creation_de_lock = 0;
wake_up(&s->s_hpfs_creation_de);
up(&s->u.hpfs_sb.hpfs_creation_de);
}
void hpfs_lock_iget(struct super_block *s, int mode)
......
......@@ -427,8 +427,8 @@ struct super_block *hpfs_read_super(struct super_block *s, void *options,
s->s_hpfs_bmp_dir = NULL;
s->s_hpfs_cp_table = NULL;
s->s_hpfs_creation_de_lock = s->s_hpfs_rd_inode = 0;
init_waitqueue_head(&s->s_hpfs_creation_de);
s->s_hpfs_rd_inode = 0;
init_MUTEX(&s->u.hpfs_sb.hpfs_creation_de);
init_waitqueue_head(&s->s_hpfs_iget_q);
uid = current->uid;
......
......@@ -30,9 +30,8 @@ struct hpfs_sb_info {
/* 128 bytes lowercasing table */
unsigned *sb_bmp_dir; /* main bitmap directory */
unsigned sb_c_bitmap; /* current bitmap */
wait_queue_head_t sb_creation_de;/* when creating dirents, nobody else
struct semaphore hpfs_creation_de; /* when creating dirents, nobody else
can alloc blocks */
unsigned sb_creation_de_lock : 1;
/*unsigned sb_mounting : 1;*/
int sb_timeshift;
};
......@@ -60,8 +59,6 @@ struct hpfs_sb_info {
#define s_hpfs_cp_table u.hpfs_sb.sb_cp_table
#define s_hpfs_bmp_dir u.hpfs_sb.sb_bmp_dir
#define s_hpfs_c_bitmap u.hpfs_sb.sb_c_bitmap
#define s_hpfs_creation_de u.hpfs_sb.sb_creation_de
#define s_hpfs_creation_de_lock u.hpfs_sb.sb_creation_de_lock
#define s_hpfs_iget_q u.hpfs_sb.sb_iget_q
/*#define s_hpfs_mounting u.hpfs_sb.sb_mounting*/
#define s_hpfs_timeshift u.hpfs_sb.sb_timeshift
......
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