diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-06 03:46:02 -0500 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-01-06 03:46:02 -0500 |
commit | 64100099ed22f71cce656c5c2caecf5c9cf255dc (patch) | |
tree | f6ebf7c94ee2eeb080d25880ffca839ec39ec47e /block | |
parent | 80cfd548eed68cf90c5ae9cfcd6b02230cece756 (diff) |
[BLOCK] mark some block/ variables cons
the patch below marks various read-only variables in block/* as const,
so that gcc can optimize the use of them; eg gcc will replace the use by
the value directly now and will even remove the memory usage of these.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 16 | ||||
-rw-r--r-- | block/deadline-iosched.c | 8 | ||||
-rw-r--r-- | block/ll_rw_blk.c | 2 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index ee0bb41694b0..74fae2daf87e 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -25,15 +25,15 @@ | |||
25 | /* | 25 | /* |
26 | * tunables | 26 | * tunables |
27 | */ | 27 | */ |
28 | static int cfq_quantum = 4; /* max queue in one round of service */ | 28 | static const int cfq_quantum = 4; /* max queue in one round of service */ |
29 | static int cfq_queued = 8; /* minimum rq allocate limit per-queue*/ | 29 | static const int cfq_queued = 8; /* minimum rq allocate limit per-queue*/ |
30 | static int cfq_fifo_expire[2] = { HZ / 4, HZ / 8 }; | 30 | static const int cfq_fifo_expire[2] = { HZ / 4, HZ / 8 }; |
31 | static int cfq_back_max = 16 * 1024; /* maximum backwards seek, in KiB */ | 31 | static const int cfq_back_max = 16 * 1024; /* maximum backwards seek, in KiB */ |
32 | static int cfq_back_penalty = 2; /* penalty of a backwards seek */ | 32 | static const int cfq_back_penalty = 2; /* penalty of a backwards seek */ |
33 | 33 | ||
34 | static int cfq_slice_sync = HZ / 10; | 34 | static const int cfq_slice_sync = HZ / 10; |
35 | static int cfq_slice_async = HZ / 25; | 35 | static int cfq_slice_async = HZ / 25; |
36 | static int cfq_slice_async_rq = 2; | 36 | static const int cfq_slice_async_rq = 2; |
37 | static int cfq_slice_idle = HZ / 100; | 37 | static int cfq_slice_idle = HZ / 100; |
38 | 38 | ||
39 | #define CFQ_IDLE_GRACE (HZ / 10) | 39 | #define CFQ_IDLE_GRACE (HZ / 10) |
@@ -45,7 +45,7 @@ static int cfq_slice_idle = HZ / 100; | |||
45 | /* | 45 | /* |
46 | * disable queueing at the driver/hardware level | 46 | * disable queueing at the driver/hardware level |
47 | */ | 47 | */ |
48 | static int cfq_max_depth = 2; | 48 | static const int cfq_max_depth = 2; |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * for the hash of cfqq inside the cfqd | 51 | * for the hash of cfqq inside the cfqd |
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index 9cbec09e8415..27e494b1bf97 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c | |||
@@ -19,10 +19,10 @@ | |||
19 | /* | 19 | /* |
20 | * See Documentation/block/deadline-iosched.txt | 20 | * See Documentation/block/deadline-iosched.txt |
21 | */ | 21 | */ |
22 | static int read_expire = HZ / 2; /* max time before a read is submitted. */ | 22 | static const int read_expire = HZ / 2; /* max time before a read is submitted. */ |
23 | static int write_expire = 5 * HZ; /* ditto for writes, these limits are SOFT! */ | 23 | static const int write_expire = 5 * HZ; /* ditto for writes, these limits are SOFT! */ |
24 | static int writes_starved = 2; /* max times reads can starve a write */ | 24 | static const int writes_starved = 2; /* max times reads can starve a write */ |
25 | static int fifo_batch = 16; /* # of sequential requests treated as one | 25 | static const int fifo_batch = 16; /* # of sequential requests treated as one |
26 | by the above parameters. For throughput. */ | 26 | by the above parameters. For throughput. */ |
27 | 27 | ||
28 | static const int deadline_hash_shift = 5; | 28 | static const int deadline_hash_shift = 5; |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 97f4e7ecedfe..e02c88ca8fb5 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1039,7 +1039,7 @@ void blk_queue_invalidate_tags(request_queue_t *q) | |||
1039 | 1039 | ||
1040 | EXPORT_SYMBOL(blk_queue_invalidate_tags); | 1040 | EXPORT_SYMBOL(blk_queue_invalidate_tags); |
1041 | 1041 | ||
1042 | static char *rq_flags[] = { | 1042 | static const char * const rq_flags[] = { |
1043 | "REQ_RW", | 1043 | "REQ_RW", |
1044 | "REQ_FAILFAST", | 1044 | "REQ_FAILFAST", |
1045 | "REQ_SORTED", | 1045 | "REQ_SORTED", |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 1d8852f7bbff..c2ac36dfe4f3 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -46,7 +46,7 @@ EXPORT_SYMBOL(scsi_command_size); | |||
46 | 46 | ||
47 | static int sg_get_version(int __user *p) | 47 | static int sg_get_version(int __user *p) |
48 | { | 48 | { |
49 | static int sg_version_num = 30527; | 49 | static const int sg_version_num = 30527; |
50 | return put_user(sg_version_num, p); | 50 | return put_user(sg_version_num, p); |
51 | } | 51 | } |
52 | 52 | ||