diff options
-rw-r--r-- | drivers/block/brd.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 9d5335857191..ad793f35632c 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c | |||
@@ -395,44 +395,9 @@ static long brd_direct_access(struct block_device *bdev, sector_t sector, | |||
395 | #define brd_direct_access NULL | 395 | #define brd_direct_access NULL |
396 | #endif | 396 | #endif |
397 | 397 | ||
398 | static int brd_ioctl(struct block_device *bdev, fmode_t mode, | ||
399 | unsigned int cmd, unsigned long arg) | ||
400 | { | ||
401 | int error; | ||
402 | struct brd_device *brd = bdev->bd_disk->private_data; | ||
403 | |||
404 | if (cmd != BLKFLSBUF) | ||
405 | return -ENOTTY; | ||
406 | |||
407 | /* | ||
408 | * ram device BLKFLSBUF has special semantics, we want to actually | ||
409 | * release and destroy the ramdisk data. | ||
410 | */ | ||
411 | mutex_lock(&brd_mutex); | ||
412 | mutex_lock(&bdev->bd_mutex); | ||
413 | error = -EBUSY; | ||
414 | if (bdev->bd_openers <= 1) { | ||
415 | /* | ||
416 | * Kill the cache first, so it isn't written back to the | ||
417 | * device. | ||
418 | * | ||
419 | * Another thread might instantiate more buffercache here, | ||
420 | * but there is not much we can do to close that race. | ||
421 | */ | ||
422 | kill_bdev(bdev); | ||
423 | brd_free_pages(brd); | ||
424 | error = 0; | ||
425 | } | ||
426 | mutex_unlock(&bdev->bd_mutex); | ||
427 | mutex_unlock(&brd_mutex); | ||
428 | |||
429 | return error; | ||
430 | } | ||
431 | |||
432 | static const struct block_device_operations brd_fops = { | 398 | static const struct block_device_operations brd_fops = { |
433 | .owner = THIS_MODULE, | 399 | .owner = THIS_MODULE, |
434 | .rw_page = brd_rw_page, | 400 | .rw_page = brd_rw_page, |
435 | .ioctl = brd_ioctl, | ||
436 | .direct_access = brd_direct_access, | 401 | .direct_access = brd_direct_access, |
437 | }; | 402 | }; |
438 | 403 | ||