aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo2008-09-03 02:01:09 -0500
committerJens Axboe2008-10-09 01:56:05 -0500
commitcf771cb5a7b716f3f9e532fd42a1e3a0a75adec5 (patch)
treec16cf6adc4d2e51eaee77088ecf126b721f8f3c7 /block/ioctl.c
parent310a2c1012934f590192377f65940cad4aa72b15 (diff)
downloadkernel-common-cf771cb5a7b716f3f9e532fd42a1e3a0a75adec5.tar.gz
kernel-common-cf771cb5a7b716f3f9e532fd42a1e3a0a75adec5.tar.xz
kernel-common-cf771cb5a7b716f3f9e532fd42a1e3a0a75adec5.zip
block: make variable and argument names more consistent
In hd_struct, @partno is used to denote partition number and a number of other places use @part to denote hd_struct. Functions use @part and @index instead. This causes confusion and makes it difficult to use consistent variable names for hd_struct. Always use @partno if a variable represents partition number. Also, print out functions use @f or @part for seq_file argument. Use @seqf uniformly instead. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/ioctl.c')
-rw-r--r--block/ioctl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index eb046aeede8..d77f5e280a6 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -15,7 +15,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
15 struct blkpg_ioctl_arg a; 15 struct blkpg_ioctl_arg a;
16 struct blkpg_partition p; 16 struct blkpg_partition p;
17 long long start, length; 17 long long start, length;
18 int part; 18 int partno;
19 int i; 19 int i;
20 int err; 20 int err;
21 21
@@ -28,8 +28,8 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
28 disk = bdev->bd_disk; 28 disk = bdev->bd_disk;
29 if (bdev != bdev->bd_contains) 29 if (bdev != bdev->bd_contains)
30 return -EINVAL; 30 return -EINVAL;
31 part = p.pno; 31 partno = p.pno;
32 if (part <= 0 || part >= disk->minors) 32 if (partno <= 0 || partno >= disk->minors)
33 return -EINVAL; 33 return -EINVAL;
34 switch (a.op) { 34 switch (a.op) {
35 case BLKPG_ADD_PARTITION: 35 case BLKPG_ADD_PARTITION:
@@ -59,13 +59,14 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
59 } 59 }
60 } 60 }
61 /* all seems OK */ 61 /* all seems OK */
62 err = add_partition(disk, part, start, length, ADDPART_FLAG_NONE); 62 err = add_partition(disk, partno, start, length,
63 ADDPART_FLAG_NONE);
63 mutex_unlock(&bdev->bd_mutex); 64 mutex_unlock(&bdev->bd_mutex);
64 return err; 65 return err;
65 case BLKPG_DEL_PARTITION: 66 case BLKPG_DEL_PARTITION:
66 if (!disk->part[part-1]) 67 if (!disk->part[partno - 1])
67 return -ENXIO; 68 return -ENXIO;
68 bdevp = bdget_disk(disk, part); 69 bdevp = bdget_disk(disk, partno);
69 if (!bdevp) 70 if (!bdevp)
70 return -ENOMEM; 71 return -ENOMEM;
71 mutex_lock(&bdevp->bd_mutex); 72 mutex_lock(&bdevp->bd_mutex);
@@ -79,7 +80,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
79 invalidate_bdev(bdevp); 80 invalidate_bdev(bdevp);
80 81
81 mutex_lock_nested(&bdev->bd_mutex, 1); 82 mutex_lock_nested(&bdev->bd_mutex, 1);
82 delete_partition(disk, part); 83 delete_partition(disk, partno);
83 mutex_unlock(&bdev->bd_mutex); 84 mutex_unlock(&bdev->bd_mutex);
84 mutex_unlock(&bdevp->bd_mutex); 85 mutex_unlock(&bdevp->bd_mutex);
85 bdput(bdevp); 86 bdput(bdevp);