mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
mtd_blkdevs: don't override BLKFLSBUF
BLKFLSBUF is not supposed to actually send a flush command to the device, but to tear down buffer cache structures. Remove the mtd_blkdevs implementation and just use the default semantics instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
09162bc32c
commit
daaedb820a
@@ -298,38 +298,10 @@ unlock:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
|
|
||||||
unsigned int cmd, unsigned long arg)
|
|
||||||
{
|
|
||||||
struct mtd_blktrans_dev *dev = blktrans_dev_get(bdev->bd_disk);
|
|
||||||
int ret = -ENXIO;
|
|
||||||
|
|
||||||
if (!dev)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
mutex_lock(&dev->lock);
|
|
||||||
|
|
||||||
if (!dev->mtd)
|
|
||||||
goto unlock;
|
|
||||||
|
|
||||||
switch (cmd) {
|
|
||||||
case BLKFLSBUF:
|
|
||||||
ret = dev->tr->flush ? dev->tr->flush(dev) : 0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = -ENOTTY;
|
|
||||||
}
|
|
||||||
unlock:
|
|
||||||
mutex_unlock(&dev->lock);
|
|
||||||
blktrans_dev_put(dev);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct block_device_operations mtd_block_ops = {
|
static const struct block_device_operations mtd_block_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = blktrans_open,
|
.open = blktrans_open,
|
||||||
.release = blktrans_release,
|
.release = blktrans_release,
|
||||||
.ioctl = blktrans_ioctl,
|
|
||||||
.getgeo = blktrans_getgeo,
|
.getgeo = blktrans_getgeo,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user