Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285134
b: refs/heads/master
c: ae18be1
h: refs/heads/master
v: v3
  • Loading branch information
Li Dongyang authored and Konrad Rzeszutek Wilk committed Nov 18, 2011
1 parent dc69c96 commit 6f7f638
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 421463526fd1d8b5cb575baca12667c1005a110b
refs/heads/master: ae18be11b5ccc3be9e268592616488c5f9d987f5
19 changes: 2 additions & 17 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
#include <linux/list.h>
#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/loop.h>
#include <linux/falloc.h>
#include <linux/fs.h>

#include <xen/events.h>
#include <xen/page.h>
Expand Down Expand Up @@ -426,27 +423,15 @@ static int dispatch_discard_io(struct xen_blkif *blkif,
blkif->st_ds_req++;

xen_blkif_get(blkif);
if (blkif->blk_backend_type == BLKIF_BACKEND_PHY) {
if (blkif->blk_backend_type == BLKIF_BACKEND_PHY ||
blkif->blk_backend_type == BLKIF_BACKEND_FILE) {
unsigned long secure = (blkif->vbd.discard_secure &&
(req->u.discard.flag & BLKIF_DISCARD_SECURE)) ?
BLKDEV_DISCARD_SECURE : 0;
/* just forward the discard request */
err = blkdev_issue_discard(bdev,
req->u.discard.sector_number,
req->u.discard.nr_sectors,
GFP_KERNEL, secure);
} else if (blkif->blk_backend_type == BLKIF_BACKEND_FILE) {
/* punch a hole in the backing file */
struct loop_device *lo = bdev->bd_disk->private_data;
struct file *file = lo->lo_backing_file;

if (file->f_op->fallocate)
err = file->f_op->fallocate(file,
FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,
req->u.discard.sector_number << 9,
req->u.discard.nr_sectors << 9);
else
err = -EOPNOTSUPP;
} else
err = -EOPNOTSUPP;

Expand Down

0 comments on commit 6f7f638

Please sign in to comment.