Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4385bab1 authored by Al Viro's avatar Al Viro
Browse files

make blkdev_put() return void



same story as with the previous patches - note that return
value of blkdev_close() is lost, since there's nowhere the
caller (__fput()) could return it to.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent db2a144b
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1045,7 +1045,7 @@ void bd_set_size(struct block_device *bdev, loff_t size)
}
EXPORT_SYMBOL(bd_set_size);

static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);

/*
 * bd_mutex locking:
@@ -1400,9 +1400,8 @@ static int blkdev_open(struct inode * inode, struct file * filp)
	return blkdev_get(bdev, filp->f_mode, filp);
}

static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
{
	int ret = 0;
	struct gendisk *disk = bdev->bd_disk;
	struct block_device *victim = NULL;

@@ -1441,10 +1440,9 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
	bdput(bdev);
	if (victim)
		__blkdev_put(victim, mode, 1);
	return ret;
}

int blkdev_put(struct block_device *bdev, fmode_t mode)
void blkdev_put(struct block_device *bdev, fmode_t mode)
{
	mutex_lock(&bdev->bd_mutex);

@@ -1488,15 +1486,15 @@ int blkdev_put(struct block_device *bdev, fmode_t mode)

	mutex_unlock(&bdev->bd_mutex);

	return __blkdev_put(bdev, mode, 0);
	__blkdev_put(bdev, mode, 0);
}
EXPORT_SYMBOL(blkdev_put);

static int blkdev_close(struct inode * inode, struct file * filp)
{
	struct block_device *bdev = I_BDEV(filp->f_mapping->host);

	return blkdev_put(bdev, filp->f_mode);
	blkdev_put(bdev, filp->f_mode);
	return 0;
}

static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
+4 −7
Original line number Diff line number Diff line
@@ -362,22 +362,19 @@ fail:
/*
 * Release the journal device
 */
static int ext3_blkdev_put(struct block_device *bdev)
static void ext3_blkdev_put(struct block_device *bdev)
{
	return blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
	blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
}

static int ext3_blkdev_remove(struct ext3_sb_info *sbi)
static void ext3_blkdev_remove(struct ext3_sb_info *sbi)
{
	struct block_device *bdev;
	int ret = -ENODEV;

	bdev = sbi->journal_bdev;
	if (bdev) {
		ret = ext3_blkdev_put(bdev);
		ext3_blkdev_put(bdev);
		sbi->journal_bdev = NULL;
	}
	return ret;
}

static inline struct inode *orphan_list_entry(struct list_head *l)
+4 −7
Original line number Diff line number Diff line
@@ -703,22 +703,19 @@ fail:
/*
 * Release the journal device
 */
static int ext4_blkdev_put(struct block_device *bdev)
static void ext4_blkdev_put(struct block_device *bdev)
{
	return blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
	blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
}

static int ext4_blkdev_remove(struct ext4_sb_info *sbi)
static void ext4_blkdev_remove(struct ext4_sb_info *sbi)
{
	struct block_device *bdev;
	int ret = -ENODEV;

	bdev = sbi->journal_bdev;
	if (bdev) {
		ret = ext4_blkdev_put(bdev);
		ext4_blkdev_put(bdev);
		sbi->journal_bdev = NULL;
	}
	return ret;
}

static inline struct inode *orphan_list_entry(struct list_head *l)
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ struct bl_msg_hdr {
/* blocklayoutdev.c */
ssize_t bl_pipe_downcall(struct file *, const char __user *, size_t);
void bl_pipe_destroy_msg(struct rpc_pipe_msg *);
int nfs4_blkdev_put(struct block_device *bdev);
void nfs4_blkdev_put(struct block_device *bdev);
struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server,
						struct pnfs_device *dev);
int nfs4_blk_process_layoutget(struct pnfs_layout_hdr *lo,
+2 −2
Original line number Diff line number Diff line
@@ -56,11 +56,11 @@ static int decode_sector_number(__be32 **rp, sector_t *sp)
/*
 * Release the block device
 */
int nfs4_blkdev_put(struct block_device *bdev)
void nfs4_blkdev_put(struct block_device *bdev)
{
	dprintk("%s for device %d:%d\n", __func__, MAJOR(bdev->bd_dev),
			MINOR(bdev->bd_dev));
	return blkdev_put(bdev, FMODE_READ);
	blkdev_put(bdev, FMODE_READ);
}

ssize_t bl_pipe_downcall(struct file *filp, const char __user *src,
Loading