Commit e6a1c874 authored by Jens Axboe's avatar Jens Axboe Committed by Jens Axboe

[PATCH] struct request: shrink and optimize some more

Move some members around and unionize completion_data and rb_node since
they cannot ever be used at the same time.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent 51da90fc
...@@ -211,6 +211,8 @@ struct request { ...@@ -211,6 +211,8 @@ struct request {
struct list_head queuelist; struct list_head queuelist;
struct list_head donelist; struct list_head donelist;
request_queue_t *q;
unsigned int cmd_flags; unsigned int cmd_flags;
enum rq_cmd_type_bits cmd_type; enum rq_cmd_type_bits cmd_type;
...@@ -219,12 +221,12 @@ struct request { ...@@ -219,12 +221,12 @@ struct request {
*/ */
sector_t sector; /* next sector to submit */ sector_t sector; /* next sector to submit */
sector_t hard_sector; /* next sector to complete */
unsigned long nr_sectors; /* no. of sectors left to submit */ unsigned long nr_sectors; /* no. of sectors left to submit */
unsigned long hard_nr_sectors; /* no. of sectors left to complete */
/* no. of sectors left to submit in the current segment */ /* no. of sectors left to submit in the current segment */
unsigned int current_nr_sectors; unsigned int current_nr_sectors;
sector_t hard_sector; /* next sector to complete */
unsigned long hard_nr_sectors; /* no. of sectors left to complete */
/* no. of sectors left to complete in the current segment */ /* no. of sectors left to complete in the current segment */
unsigned int hard_cur_sectors; unsigned int hard_cur_sectors;
...@@ -232,7 +234,15 @@ struct request { ...@@ -232,7 +234,15 @@ struct request {
struct bio *biotail; struct bio *biotail;
struct hlist_node hash; /* merge hash */ struct hlist_node hash; /* merge hash */
/*
* The rb_node is only used inside the io scheduler, requests
* are pruned when moved to the dispatch queue. So let the
* completion_data share space with the rb_node.
*/
union {
struct rb_node rb_node; /* sort/lookup */ struct rb_node rb_node; /* sort/lookup */
void *completion_data;
};
/* /*
* two pointers are available for the IO schedulers, if they need * two pointers are available for the IO schedulers, if they need
...@@ -241,8 +251,6 @@ struct request { ...@@ -241,8 +251,6 @@ struct request {
void *elevator_private; void *elevator_private;
void *elevator_private2; void *elevator_private2;
void *completion_data;
struct gendisk *rq_disk; struct gendisk *rq_disk;
unsigned long start_time; unsigned long start_time;
...@@ -260,8 +268,6 @@ struct request { ...@@ -260,8 +268,6 @@ struct request {
unsigned short ioprio; unsigned short ioprio;
request_queue_t *q;
void *special; void *special;
char *buffer; char *buffer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment