diff options
author | Anton Altaparmakov <aia21@hera.kernel.org> | 2006-03-23 17:05:47 +0000 |
---|---|---|
committer | Anton Altaparmakov <aia21@hera.kernel.org> | 2006-03-23 17:05:47 +0000 |
commit | a05ba4561fa3ad8b64a27577d0d38c190f60f762 (patch) | |
tree | 5eb7561113e006b7bad0bef50dec6821962b1b36 /block/ioctl.c | |
parent | 74293759002aa7db0179158c20676a034614577b (diff) | |
parent | b0e6e962992b76580f4900b166a337bad7c1e81b (diff) | |
download | kernel_samsung_tuna-a05ba4561fa3ad8b64a27577d0d38c190f60f762.zip kernel_samsung_tuna-a05ba4561fa3ad8b64a27577d0d38c190f60f762.tar.gz kernel_samsung_tuna-a05ba4561fa3ad8b64a27577d0d38c190f60f762.tar.bz2 |
Merge branch 'master' of /home/aia21/ntfs-2.6/
Diffstat (limited to 'block/ioctl.c')
-rw-r--r-- | block/ioctl.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index e110949..35fdb7d 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -42,9 +42,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user return -EINVAL; } /* partition number in use? */ - down(&bdev->bd_sem); + mutex_lock(&bdev->bd_mutex); if (disk->part[part - 1]) { - up(&bdev->bd_sem); + mutex_unlock(&bdev->bd_mutex); return -EBUSY; } /* overlap? */ @@ -55,13 +55,13 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user continue; if (!(start+length <= s->start_sect || start >= s->start_sect + s->nr_sects)) { - up(&bdev->bd_sem); + mutex_unlock(&bdev->bd_mutex); return -EBUSY; } } /* all seems OK */ add_partition(disk, part, start, length); - up(&bdev->bd_sem); + mutex_unlock(&bdev->bd_mutex); return 0; case BLKPG_DEL_PARTITION: if (!disk->part[part-1]) @@ -71,9 +71,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user bdevp = bdget_disk(disk, part); if (!bdevp) return -ENOMEM; - down(&bdevp->bd_sem); + mutex_lock(&bdevp->bd_mutex); if (bdevp->bd_openers) { - up(&bdevp->bd_sem); + mutex_unlock(&bdevp->bd_mutex); bdput(bdevp); return -EBUSY; } @@ -81,10 +81,10 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user fsync_bdev(bdevp); invalidate_bdev(bdevp, 0); - down(&bdev->bd_sem); + mutex_lock(&bdev->bd_mutex); delete_partition(disk, part); - up(&bdev->bd_sem); - up(&bdevp->bd_sem); + mutex_unlock(&bdev->bd_mutex); + mutex_unlock(&bdevp->bd_mutex); bdput(bdevp); return 0; @@ -102,10 +102,10 @@ static int blkdev_reread_part(struct block_device *bdev) return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EACCES; - if (down_trylock(&bdev->bd_sem)) + if (!mutex_trylock(&bdev->bd_mutex)) return -EBUSY; res = rescan_partitions(disk, bdev); - up(&bdev->bd_sem); + mutex_unlock(&bdev->bd_mutex); return res; } |