git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://github.com/davem330/sparc
[pandora-kernel.git]
/
block
/
blk-cgroup.c
diff --git
a/block/blk-cgroup.c
b/block/blk-cgroup.c
index
bcaf16e
..
b596e54
100644
(file)
--- a/
block/blk-cgroup.c
+++ b/
block/blk-cgroup.c
@@
-785,10
+785,10
@@
static int blkio_policy_parse_and_set(char *buf,
{
char *s[4], *p, *major_s = NULL, *minor_s = NULL;
int ret;
{
char *s[4], *p, *major_s = NULL, *minor_s = NULL;
int ret;
- unsigned long major, minor
, temp
;
+ unsigned long major, minor;
int i = 0;
dev_t dev;
int i = 0;
dev_t dev;
- u64
bps, iops
;
+ u64
temp
;
memset(s, 0, sizeof(s));
memset(s, 0, sizeof(s));
@@
-826,20
+826,23
@@
static int blkio_policy_parse_and_set(char *buf,
dev = MKDEV(major, minor);
dev = MKDEV(major, minor);
- ret =
blkio_check_dev_num(dev
);
+ ret =
strict_strtoull(s[1], 10, &temp
);
if (ret)
if (ret)
- return
ret
;
+ return
-EINVAL
;
- newpn->dev = dev;
+ /* For rule removal, do not check for device presence. */
+ if (temp) {
+ ret = blkio_check_dev_num(dev);
+ if (ret)
+ return ret;
+ }
- if (s[1] == NULL)
- return -EINVAL;
+ newpn->dev = dev;
switch (plid) {
case BLKIO_POLICY_PROP:
switch (plid) {
case BLKIO_POLICY_PROP:
- ret = strict_strtoul(s[1], 10, &temp);
- if (ret || (temp < BLKIO_WEIGHT_MIN && temp > 0) ||
- temp > BLKIO_WEIGHT_MAX)
+ if ((temp < BLKIO_WEIGHT_MIN && temp > 0) ||
+ temp > BLKIO_WEIGHT_MAX)
return -EINVAL;
newpn->plid = plid;
return -EINVAL;
newpn->plid = plid;
@@
-850,26
+853,18
@@
static int blkio_policy_parse_and_set(char *buf,
switch(fileid) {
case BLKIO_THROTL_read_bps_device:
case BLKIO_THROTL_write_bps_device:
switch(fileid) {
case BLKIO_THROTL_read_bps_device:
case BLKIO_THROTL_write_bps_device:
- ret = strict_strtoull(s[1], 10, &bps);
- if (ret)
- return -EINVAL;
-
newpn->plid = plid;
newpn->fileid = fileid;
newpn->plid = plid;
newpn->fileid = fileid;
- newpn->val.bps =
bps
;
+ newpn->val.bps =
temp
;
break;
case BLKIO_THROTL_read_iops_device:
case BLKIO_THROTL_write_iops_device:
break;
case BLKIO_THROTL_read_iops_device:
case BLKIO_THROTL_write_iops_device:
- ret = strict_strtoull(s[1], 10, &iops);
- if (ret)
- return -EINVAL;
-
- if (iops > THROTL_IOPS_MAX)
+ if (temp > THROTL_IOPS_MAX)
return -EINVAL;
newpn->plid = plid;
newpn->fileid = fileid;
return -EINVAL;
newpn->plid = plid;
newpn->fileid = fileid;
- newpn->val.iops = (unsigned int)
iops
;
+ newpn->val.iops = (unsigned int)
temp
;
break;
}
break;
break;
}
break;