Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236050
b: refs/heads/master
c: 6642a67
h: refs/heads/master
v: v3
  • Loading branch information
Jerome Marchand authored and Greg Kroah-Hartman committed Feb 18, 2011
1 parent 3ffdf18 commit 9cd66bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 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: 69648bed5383d5e9454aa9dc922dee4db2eef794
refs/heads/master: 6642a67c552e6d525913bb5fb4a00b2008213451
19 changes: 7 additions & 12 deletions trunk/drivers/staging/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ static void zram_read(struct zram *zram, struct bio *bio)
u32 index;
struct bio_vec *bvec;

if (unlikely(!zram->init_done)) {
bio_endio(bio, -ENXIO);
return;
}

zram_stat64_inc(zram, &zram->stats.num_reads);
index = bio->bi_sector >> SECTORS_PER_PAGE_SHIFT;

Expand Down Expand Up @@ -286,20 +281,15 @@ static void zram_read(struct zram *zram, struct bio *bio)

static void zram_write(struct zram *zram, struct bio *bio)
{
int i, ret;
int i;
u32 index;
struct bio_vec *bvec;

if (unlikely(!zram->init_done)) {
ret = zram_init_device(zram);
if (ret)
goto out;
}

zram_stat64_inc(zram, &zram->stats.num_writes);
index = bio->bi_sector >> SECTORS_PER_PAGE_SHIFT;

bio_for_each_segment(bvec, bio, i) {
int ret;
u32 offset;
size_t clen;
struct zobj_header *zheader;
Expand Down Expand Up @@ -445,6 +435,11 @@ static int zram_make_request(struct request_queue *queue, struct bio *bio)
return 0;
}

if (unlikely(!zram->init_done) && zram_init_device(zram)) {
bio_io_error(bio);
return 0;
}

switch (bio_data_dir(bio)) {
case READ:
zram_read(zram, bio);
Expand Down

0 comments on commit 9cd66bd

Please sign in to comment.