Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273806
b: refs/heads/master
c: 456be14
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Oct 17, 2011
1 parent 1edbf8a commit 701136f
Show file tree
Hide file tree
Showing 43 changed files with 518 additions and 628 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: 9562ad9ab36df7ccef920d119f3b5100025db95f
refs/heads/master: 456be1484ffc72a24bdb4200b5847c4fa90139d9
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 1
SUBLEVEL = 0
EXTRAVERSION = -rc10
EXTRAVERSION = -rc9
NAME = "Divemaster Edition"

# *DOCUMENTATION*
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/m68k/emu/nfblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct nfhd_device {
struct gendisk *disk;
};

static void nfhd_make_request(struct request_queue *queue, struct bio *bio)
static int nfhd_make_request(struct request_queue *queue, struct bio *bio)
{
struct nfhd_device *dev = queue->queuedata;
struct bio_vec *bvec;
Expand All @@ -76,6 +76,7 @@ static void nfhd_make_request(struct request_queue *queue, struct bio *bio)
sec += len;
}
bio_endio(bio, 0);
return 0;
}

static int nfhd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/powerpc/sysdev/axonram.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ axon_ram_irq_handler(int irq, void *dev)
* axon_ram_make_request - make_request() method for block device
* @queue, @bio: see blk_queue_make_request()
*/
static void
static int
axon_ram_make_request(struct request_queue *queue, struct bio *bio)
{
struct axon_ram_bank *bank = bio->bi_bdev->bd_disk->private_data;
Expand All @@ -113,14 +113,16 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
struct bio_vec *vec;
unsigned int transfered;
unsigned short idx;
int rc = 0;

phys_mem = bank->io_addr + (bio->bi_sector << AXON_RAM_SECTOR_SHIFT);
phys_end = bank->io_addr + bank->size;
transfered = 0;
bio_for_each_segment(vec, bio, idx) {
if (unlikely(phys_mem + vec->bv_len > phys_end)) {
bio_io_error(bio);
return;
rc = -ERANGE;
break;
}

user_mem = page_address(vec->bv_page) + vec->bv_offset;
Expand All @@ -133,6 +135,8 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
transfered += vec->bv_len;
}
bio_endio(bio, 0);

return rc;
}

/**
Expand Down
56 changes: 33 additions & 23 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,14 +768,25 @@ static uint64_t blkio_get_stat(struct blkio_group *blkg,
return disk_total;
}

static int blkio_check_dev_num(dev_t dev)
{
int part = 0;
struct gendisk *disk;

disk = get_gendisk(dev, &part);
if (!disk || part)
return -ENODEV;

return 0;
}

static int blkio_policy_parse_and_set(char *buf,
struct blkio_policy_node *newpn, enum blkio_policy_id plid, int fileid)
{
struct gendisk *disk = NULL;
char *s[4], *p, *major_s = NULL, *minor_s = NULL;
int ret;
unsigned long major, minor;
int i = 0, ret = -EINVAL;
int part;
int i = 0;
dev_t dev;
u64 temp;

Expand All @@ -793,36 +804,37 @@ static int blkio_policy_parse_and_set(char *buf,
}

if (i != 2)
goto out;
return -EINVAL;

p = strsep(&s[0], ":");
if (p != NULL)
major_s = p;
else
goto out;
return -EINVAL;

minor_s = s[0];
if (!minor_s)
goto out;
return -EINVAL;

if (strict_strtoul(major_s, 10, &major))
goto out;
ret = strict_strtoul(major_s, 10, &major);
if (ret)
return -EINVAL;

if (strict_strtoul(minor_s, 10, &minor))
goto out;
ret = strict_strtoul(minor_s, 10, &minor);
if (ret)
return -EINVAL;

dev = MKDEV(major, minor);

if (strict_strtoull(s[1], 10, &temp))
goto out;
ret = strict_strtoull(s[1], 10, &temp);
if (ret)
return -EINVAL;

/* For rule removal, do not check for device presence. */
if (temp) {
disk = get_gendisk(dev, &part);
if (!disk || part) {
ret = -ENODEV;
goto out;
}
ret = blkio_check_dev_num(dev);
if (ret)
return ret;
}

newpn->dev = dev;
Expand All @@ -831,7 +843,7 @@ static int blkio_policy_parse_and_set(char *buf,
case BLKIO_POLICY_PROP:
if ((temp < BLKIO_WEIGHT_MIN && temp > 0) ||
temp > BLKIO_WEIGHT_MAX)
goto out;
return -EINVAL;

newpn->plid = plid;
newpn->fileid = fileid;
Expand All @@ -848,7 +860,7 @@ static int blkio_policy_parse_and_set(char *buf,
case BLKIO_THROTL_read_iops_device:
case BLKIO_THROTL_write_iops_device:
if (temp > THROTL_IOPS_MAX)
goto out;
return -EINVAL;

newpn->plid = plid;
newpn->fileid = fileid;
Expand All @@ -859,10 +871,8 @@ static int blkio_policy_parse_and_set(char *buf,
default:
BUG();
}
ret = 0;
out:
put_disk(disk);
return ret;

return 0;
}

unsigned int blkcg_get_weight(struct blkio_cgroup *blkcg,
Expand Down
2 changes: 1 addition & 1 deletion trunk/block/blk-cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ struct blkio_policy_node {
union {
unsigned int weight;
/*
* Rate read/write in terms of bytes per second
* Rate read/write in terms of byptes per second
* Whether this rate represents read or write is determined
* by file type "fileid".
*/
Expand Down
Loading

0 comments on commit 701136f

Please sign in to comment.