Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
daaedb82 09162bc3

-28
-28
drivers/mtd/mtd_blkdevs.c
··· 298 298 return ret; 299 299 } 300 300 301 - static int blktrans_ioctl(struct block_device *bdev, fmode_t mode, 302 - unsigned int cmd, unsigned long arg) 303 - { 304 - struct mtd_blktrans_dev *dev = blktrans_dev_get(bdev->bd_disk); 305 - int ret = -ENXIO; 306 - 307 - if (!dev) 308 - return ret; 309 - 310 - mutex_lock(&dev->lock); 311 - 312 - if (!dev->mtd) 313 - goto unlock; 314 - 315 - switch (cmd) { 316 - case BLKFLSBUF: 317 - ret = dev->tr->flush ? dev->tr->flush(dev) : 0; 318 - break; 319 - default: 320 - ret = -ENOTTY; 321 - } 322 - unlock: 323 - mutex_unlock(&dev->lock); 324 - blktrans_dev_put(dev); 325 - return ret; 326 - } 327 - 328 301 static const struct block_device_operations mtd_block_ops = { 329 302 .owner = THIS_MODULE, 330 303 .open = blktrans_open, 331 304 .release = blktrans_release, 332 - .ioctl = blktrans_ioctl, 333 305 .getgeo = blktrans_getgeo, 334 306 }; 335 307