mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
310a2c1012
commit
cf771cb5a7
5 changed files with 60 additions and 62 deletions
|
@ -930,7 +930,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
|
|||
struct module *owner = NULL;
|
||||
struct gendisk *disk;
|
||||
int ret;
|
||||
int part;
|
||||
int partno;
|
||||
int perm = 0;
|
||||
|
||||
if (file->f_mode & FMODE_READ)
|
||||
|
@ -949,7 +949,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
|
|||
ret = -ENXIO;
|
||||
file->f_mapping = bdev->bd_inode->i_mapping;
|
||||
lock_kernel();
|
||||
disk = get_gendisk(bdev->bd_dev, &part);
|
||||
disk = get_gendisk(bdev->bd_dev, &partno);
|
||||
if (!disk) {
|
||||
unlock_kernel();
|
||||
bdput(bdev);
|
||||
|
@ -961,7 +961,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
|
|||
if (!bdev->bd_openers) {
|
||||
bdev->bd_disk = disk;
|
||||
bdev->bd_contains = bdev;
|
||||
if (!part) {
|
||||
if (!partno) {
|
||||
struct backing_dev_info *bdi;
|
||||
if (disk->fops->open) {
|
||||
ret = disk->fops->open(bdev->bd_inode, file);
|
||||
|
@ -989,7 +989,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
|
|||
if (ret)
|
||||
goto out_first;
|
||||
bdev->bd_contains = whole;
|
||||
p = disk->part[part - 1];
|
||||
p = disk->part[partno - 1];
|
||||
bdev->bd_inode->i_data.backing_dev_info =
|
||||
whole->bd_inode->i_data.backing_dev_info;
|
||||
if (!(disk->flags & GENHD_FL_UP) || !p || !p->nr_sects) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue