]> git.hungrycats.org Git - linux/commitdiff
[PATCH] hpfs cleanup (switch from sleep_on() to semaphore)
authorAlexander Viro <viro@math.psu.edu>
Wed, 6 Feb 2002 02:46:47 +0000 (18:46 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 6 Feb 2002 02:46:47 +0000 (18:46 -0800)
Pair (flag, wait_queue) in hpfs replaced with semaphore.

fs/hpfs/buffer.c
fs/hpfs/super.c
include/linux/hpfs_fs_sb.h

index 0049e5ee48fa5cbf0b5fb24ddf2ba52799b8b69e..94b663656ac42735e99542c2039d20115472d7e8 100644 (file)
@@ -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)
index 2483e920b5970e571fbfab60e856d95e09ef3fc8..3d59f27c82b88e03ab3520492ec60a15db3fdd09 100644 (file)
@@ -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;
index 9059054cf82d0be6f6f2ff2de7f0808e87f7ec07..068035e9a4bd4bfa351bf334148518a221f8da85 100644 (file)
@@ -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