Pair (flag, wait_queue) in hpfs replaced with semaphore.
#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)
#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)
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;
/* 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;
};
#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