diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-21 16:20:21 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-21 16:20:21 -0400 |
| commit | fed678dc8a8b839c8189b5d889a94e865cd327dd (patch) | |
| tree | d2bf10d2a4e4ca0a27ccd6f7ae40e8e259acfcfc | |
| parent | 808bf29b9195c52239b9aaeda7c6082a0ddf07c6 (diff) | |
| parent | 6c4867f6469964e34c5f4ee229a2a7f71a34c7ff (diff) | |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
* 'for-linus' of git://git.kernel.dk/linux-block:
floppy: use del_timer_sync() in init cleanup
blk-cgroup: be able to remove the record of unplugged device
block: Don't check QUEUE_FLAG_SAME_COMP in __blk_complete_request
mm: Add comment explaining task state setting in bdi_forker_thread()
mm: Cleanup clearing of BDI_pending bit in bdi_forker_thread()
block: simplify force plug flush code a little bit
block: change force plug flush call order
block: Fix queue_flag update when rq_affinity goes from 2 to 1
block: separate priority boosting from REQ_META
block: remove READ_META and WRITE_META
xen-blkback: fixed indentation and comments
xen-blkback: Don't disconnect backend until state switched to XenbusStateClosed.
| -rw-r--r-- | block/blk-cgroup.c | 37 | ||||
| -rw-r--r-- | block/blk-core.c | 15 | ||||
| -rw-r--r-- | block/blk-softirq.c | 2 | ||||
| -rw-r--r-- | block/blk-sysfs.c | 10 | ||||
| -rw-r--r-- | block/cfq-iosched.c | 20 | ||||
| -rw-r--r-- | drivers/block/floppy.c | 8 | ||||
| -rw-r--r-- | drivers/block/xen-blkback/common.h | 2 | ||||
| -rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 6 | ||||
| -rw-r--r-- | drivers/mmc/card/block.c | 3 | ||||
| -rw-r--r-- | fs/ext3/inode.c | 4 | ||||
| -rw-r--r-- | fs/ext3/namei.c | 3 | ||||
| -rw-r--r-- | fs/ext4/inode.c | 4 | ||||
| -rw-r--r-- | fs/ext4/namei.c | 3 | ||||
| -rw-r--r-- | fs/gfs2/log.c | 4 | ||||
| -rw-r--r-- | fs/gfs2/meta_io.c | 6 | ||||
| -rw-r--r-- | fs/gfs2/ops_fstype.c | 2 | ||||
| -rw-r--r-- | fs/gfs2/quota.c | 2 | ||||
| -rw-r--r-- | include/linux/blk_types.h | 6 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 1 | ||||
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | mm/backing-dev.c | 30 |
21 files changed, 92 insertions, 78 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index bcaf16ee6ad1..b596e54ddd71 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
| @@ -785,10 +785,10 @@ static int blkio_policy_parse_and_set(char *buf, | |||
| 785 | { | 785 | { |
| 786 | char *s[4], *p, *major_s = NULL, *minor_s = NULL; | 786 | char *s[4], *p, *major_s = NULL, *minor_s = NULL; |
| 787 | int ret; | 787 | int ret; |
| 788 | unsigned long major, minor, temp; | 788 | unsigned long major, minor; |
| 789 | int i = 0; | 789 | int i = 0; |
| 790 | dev_t dev; | 790 | dev_t dev; |
| 791 | u64 bps, iops; | 791 | u64 temp; |
| 792 | 792 | ||
| 793 | memset(s, 0, sizeof(s)); | 793 | memset(s, 0, sizeof(s)); |
| 794 | 794 | ||
| @@ -826,20 +826,23 @@ static int blkio_policy_parse_and_set(char *buf, | |||
| 826 | 826 | ||
| 827 | dev = MKDEV(major, minor); | 827 | dev = MKDEV(major, minor); |
| 828 | 828 | ||
| 829 | ret = blkio_check_dev_num(dev); | 829 | ret = strict_strtoull(s[1], 10, &temp); |
| 830 | if (ret) | 830 | if (ret) |
| 831 | return ret; | 831 | return -EINVAL; |
| 832 | 832 | ||
| 833 | newpn->dev = dev; | 833 | /* For rule removal, do not check for device presence. */ |
| 834 | if (temp) { | ||
| 835 | ret = blkio_check_dev_num(dev); | ||
| 836 | if (ret) | ||
| 837 | return ret; | ||
| 838 | } | ||
| 834 | 839 | ||
| 835 | if (s[1] == NULL) | 840 | newpn->dev = dev; |
| 836 | return -EINVAL; | ||
| 837 | 841 | ||
| 838 | switch (plid) { | 842 | switch (plid) { |
| 839 | case BLKIO_POLICY_PROP: | 843 | case BLKIO_POLICY_PROP: |
| 840 | ret = strict_strtoul(s[1], 10, &temp); | 844 | if ((temp < BLKIO_WEIGHT_MIN && temp > 0) || |
| 841 | if (ret || (temp < BLKIO_WEIGHT_MIN && temp > 0) || | 845 | temp > BLKIO_WEIGHT_MAX) |
| 842 | temp > BLKIO_WEIGHT_MAX) | ||
| 843 | return -EINVAL; | 846 | return -EINVAL; |
| 844 | 847 | ||
| 845 | newpn->plid = plid; | 848 | newpn->plid = plid; |
| @@ -850,26 +853,18 @@ static int blkio_policy_parse_and_set(char *buf, | |||
| 850 | switch(fileid) { | 853 | switch(fileid) { |
| 851 | case BLKIO_THROTL_read_bps_device: | 854 | case BLKIO_THROTL_read_bps_device: |
| 852 | case BLKIO_THROTL_write_bps_device: | 855 | case BLKIO_THROTL_write_bps_device: |
| 853 | ret = strict_strtoull(s[1], 10, &bps); | ||
| 854 | if (ret) | ||
| 855 | return -EINVAL; | ||
| 856 | |||
| 857 | newpn->plid = plid; | 856 | newpn->plid = plid; |
| 858 | newpn->fileid = fileid; | 857 | newpn->fileid = fileid; |
| 859 | newpn->val.bps = bps; | 858 | newpn->val.bps = temp; |
| 860 | break; | 859 | break; |
| 861 | case BLKIO_THROTL_read_iops_device: | 860 | case BLKIO_THROTL_read_iops_device: |
| 862 | case BLKIO_THROTL_write_iops_device: | 861 | case BLKIO_THROTL_write_iops_device: |
| 863 | ret = strict_strtoull(s[1], 10, &iops); | 862 | if (temp > THROTL_IOPS_MAX) |
| 864 | if (ret) | ||
| 865 | return -EINVAL; | ||
| 866 | |||
| 867 | if (iops > THROTL_IOPS_MAX) | ||
| 868 | return -EINVAL; | 863 | return -EINVAL; |
| 869 | 864 | ||
| 870 | newpn->plid = plid; | 865 | newpn->plid = plid; |
| 871 | newpn->fileid = fileid; | 866 | newpn->fileid = fileid; |
| 872 | newpn->val.iops = (unsigned int)iops; | 867 | newpn->val.iops = (unsigned int)temp; |
| 873 | break; | 868 | break; |
| 874 | } | 869 | } |
| 875 | break; | 870 | break; |
diff --git a/block/blk-core.c b/block/blk-core.c index 90e1ffdeb415..b2ed78afd9f0 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -1167,7 +1167,7 @@ static bool bio_attempt_front_merge(struct request_queue *q, | |||
| 1167 | * true if merge was successful, otherwise false. | 1167 | * true if merge was successful, otherwise false. |
| 1168 | */ | 1168 | */ |
| 1169 | static bool attempt_plug_merge(struct task_struct *tsk, struct request_queue *q, | 1169 | static bool attempt_plug_merge(struct task_struct *tsk, struct request_queue *q, |
| 1170 | struct bio *bio) | 1170 | struct bio *bio, unsigned int *request_count) |
| 1171 | { | 1171 | { |
| 1172 | struct blk_plug *plug; | 1172 | struct blk_plug *plug; |
| 1173 | struct request *rq; | 1173 | struct request *rq; |
| @@ -1176,10 +1176,13 @@ static bool attempt_plug_merge(struct task_struct *tsk, struct request_queue *q, | |||
| 1176 | plug = tsk->plug; | 1176 | plug = tsk->plug; |
| 1177 | if (!plug) | 1177 | if (!plug) |
| 1178 | goto out; | 1178 | goto out; |
| 1179 | *request_count = 0; | ||
| 1179 | 1180 | ||
| 1180 | list_for_each_entry_reverse(rq, &plug->list, queuelist) { | 1181 | list_for_each_entry_reverse(rq, &plug->list, queuelist) { |
| 1181 | int el_ret; | 1182 | int el_ret; |
| 1182 | 1183 | ||
| 1184 | (*request_count)++; | ||
| 1185 | |||
| 1183 | if (rq->q != q) | 1186 | if (rq->q != q) |
| 1184 | continue; | 1187 | continue; |
| 1185 | 1188 | ||
| @@ -1219,6 +1222,7 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
| 1219 | struct blk_plug *plug; | 1222 | struct blk_plug *plug; |
| 1220 | int el_ret, rw_flags, where = ELEVATOR_INSERT_SORT; | 1223 | int el_ret, rw_flags, where = ELEVATOR_INSERT_SORT; |
| 1221 | struct request *req; | 1224 | struct request *req; |
| 1225 | unsigned int request_count = 0; | ||
| 1222 | 1226 | ||
| 1223 | /* | 1227 | /* |
| 1224 | * low level driver can indicate that it wants pages above a | 1228 | * low level driver can indicate that it wants pages above a |
| @@ -1237,7 +1241,7 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
| 1237 | * Check if we can merge with the plugged list before grabbing | 1241 | * Check if we can merge with the plugged list before grabbing |
| 1238 | * any locks. | 1242 | * any locks. |
| 1239 | */ | 1243 | */ |
| 1240 | if (attempt_plug_merge(current, q, bio)) | 1244 | if (attempt_plug_merge(current, q, bio, &request_count)) |
| 1241 | goto out; | 1245 | goto out; |
| 1242 | 1246 | ||
| 1243 | spin_lock_irq(q->queue_lock); | 1247 | spin_lock_irq(q->queue_lock); |
| @@ -1302,11 +1306,10 @@ get_rq: | |||
| 1302 | if (__rq->q != q) | 1306 | if (__rq->q != q) |
| 1303 | plug->should_sort = 1; | 1307 | plug->should_sort = 1; |
| 1304 | } | 1308 | } |
| 1309 | if (request_count >= BLK_MAX_REQUEST_COUNT) | ||
| 1310 | blk_flush_plug_list(plug, false); | ||
| 1305 | list_add_tail(&req->queuelist, &plug->list); | 1311 | list_add_tail(&req->queuelist, &plug->list); |
| 1306 | plug->count++; | ||
| 1307 | drive_stat_acct(req, 1); | 1312 | drive_stat_acct(req, 1); |
| 1308 | if (plug->count >= BLK_MAX_REQUEST_COUNT) | ||
| 1309 | blk_flush_plug_list(plug, false); | ||
| 1310 | } else { | 1313 | } else { |
| 1311 | spin_lock_irq(q->queue_lock); | 1314 | spin_lock_irq(q->queue_lock); |
| 1312 | add_acct_request(q, req, where); | 1315 | add_acct_request(q, req, where); |
| @@ -2634,7 +2637,6 @@ void blk_start_plug(struct blk_plug *plug) | |||
| 2634 | INIT_LIST_HEAD(&plug->list); | 2637 | INIT_LIST_HEAD(&plug->list); |
| 2635 | INIT_LIST_HEAD(&plug->cb_list); | 2638 | INIT_LIST_HEAD(&plug->cb_list); |
