Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213066
b: refs/heads/master
c: 9355aed
h: refs/heads/master
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Oct 1, 2010
1 parent 2e1f3c8 commit e407689
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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: 5e901a2b95db709c5e40599ff4df6029be1e2a12
refs/heads/master: 9355aede5a3c4975e0ba8bbfe2b9d1fd73308916
11 changes: 7 additions & 4 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,10 @@ static int blkio_policy_parse_and_set(char *buf,
{
char *s[4], *p, *major_s = NULL, *minor_s = NULL;
int ret;
unsigned long major, minor, temp, iops;
unsigned long major, minor, temp;
int i = 0;
dev_t dev;
u64 bps;
u64 bps, iops;

memset(s, 0, sizeof(s));

Expand Down Expand Up @@ -731,13 +731,16 @@ static int blkio_policy_parse_and_set(char *buf,
break;
case BLKIO_THROTL_read_iops_device:
case BLKIO_THROTL_write_iops_device:
ret = strict_strtoul(s[1], 10, &iops);
ret = strict_strtoull(s[1], 10, &iops);
if (ret)
return -EINVAL;

if (iops > THROTL_IOPS_MAX)
return -EINVAL;

newpn->plid = plid;
newpn->fileid = fileid;
newpn->val.iops = iops;
newpn->val.iops = (unsigned int)iops;
break;
}
break;
Expand Down
3 changes: 3 additions & 0 deletions trunk/block/blk-cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ enum blkio_policy_id {
BLKIO_POLICY_THROTL, /* Throttling */
};

/* Max limits for throttle policy */
#define THROTL_IOPS_MAX UINT_MAX

#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)

#ifndef CONFIG_BLK_CGROUP
Expand Down

0 comments on commit e407689

Please sign in to comment.