Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213211
b: refs/heads/master
c: 8c55536
h: refs/heads/master
i:
  213209: 9e44c01
  213207: 404fdcb
v: v3
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Sep 10, 2010
1 parent 34682f5 commit bd26003
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 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: 31725e65c7214b52b607eba705fc4f306be4d5a5
refs/heads/master: 8c5553678237b7121355108e03c36086037d8975
18 changes: 2 additions & 16 deletions trunk/block/blk-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
{
DECLARE_COMPLETION_ONSTACK(wait);
struct request_queue *q = bdev_get_queue(bdev);
int type = flags & BLKDEV_IFL_BARRIER ?
DISCARD_BARRIER : DISCARD_NOBARRIER;
int type = REQ_WRITE | REQ_DISCARD;
unsigned int max_discard_sectors;
struct bio *bio;
int ret = 0;
Expand All @@ -65,7 +64,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
if (flags & BLKDEV_IFL_SECURE) {
if (!blk_queue_secdiscard(q))
return -EOPNOTSUPP;
type |= DISCARD_SECURE;
type |= REQ_SECURE;
}

while (nr_sects && !ret) {
Expand Down Expand Up @@ -162,12 +161,6 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
bb.wait = &wait;
bb.end_io = NULL;

if (flags & BLKDEV_IFL_BARRIER) {
/* issue async barrier before the data */
ret = blkdev_issue_flush(bdev, gfp_mask, NULL, 0);
if (ret)
return ret;
}
submit:
ret = 0;
while (nr_sects != 0) {
Expand Down Expand Up @@ -199,13 +192,6 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
issued++;
submit_bio(WRITE, bio);
}
/*
* When all data bios are in flight. Send final barrier if requeted.
*/
if (nr_sects == 0 && flags & BLKDEV_IFL_BARRIER)
ret = blkdev_issue_flush(bdev, gfp_mask, NULL,
flags & BLKDEV_IFL_WAIT);


if (flags & BLKDEV_IFL_WAIT)
/* Wait for bios in-flight */
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,9 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
}
enum{
BLKDEV_WAIT, /* wait for completion */
BLKDEV_BARRIER, /* issue request with barrier */
BLKDEV_SECURE, /* secure discard */
};
#define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT)
#define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER)
#define BLKDEV_IFL_SECURE (1 << BLKDEV_SECURE)
extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *,
unsigned long);
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,6 @@ struct inodes_stat_t {
#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
REQ_FLUSH | REQ_FUA)

/*
* These aren't really reads or writes, they pass down information about
* parts of device that are now unused by the file system.
*/
#define DISCARD_NOBARRIER (WRITE | REQ_DISCARD)
#define DISCARD_BARRIER (WRITE | REQ_DISCARD | REQ_HARDBARRIER)
#define DISCARD_SECURE (DISCARD_NOBARRIER | REQ_SECURE)

#define SEL_IN 1
#define SEL_OUT 2
#define SEL_EX 4
Expand Down

0 comments on commit bd26003

Please sign in to comment.