aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-03-25 14:46:44 -0400
committerJens Axboe <axboe@kernel.dk>2013-03-25 15:06:13 -0400
commitb1a67b0f4c747ca10c96ebb24f04e2a74b3c298d (patch)
tree32ff70d72673de4e99ae3b8c517540ccbe6a547f /drivers/md/bcache/request.c
parent07e86ccb543bb1e748f32d6f0f18913d3f58d988 (diff)
bcache: Style/checkpatch fixes
Took out some nested functions, and fixed some more checkpatch complaints. Signed-off-by: Kent Overstreet <koverstreet@google.com> Cc: linux-bcache@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r--drivers/md/bcache/request.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 4f552de49aaa..dbda9646ef38 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -1117,11 +1117,13 @@ static void add_sequential(struct task_struct *t)
1117 t->sequential_io = 0; 1117 t->sequential_io = 0;
1118} 1118}
1119 1119
1120static void check_should_skip(struct cached_dev *dc, struct search *s) 1120static struct hlist_head *iohash(struct cached_dev *dc, uint64_t k)
1121{ 1121{
1122 struct hlist_head *iohash(uint64_t k) 1122 return &dc->io_hash[hash_64(k, RECENT_IO_BITS)];
1123 { return &dc->io_hash[hash_64(k, RECENT_IO_BITS)]; } 1123}
1124 1124
1125static void check_should_skip(struct cached_dev *dc, struct search *s)
1126{
1125 struct cache_set *c = s->op.c; 1127 struct cache_set *c = s->op.c;
1126 struct bio *bio = &s->bio.bio; 1128 struct bio *bio = &s->bio.bio;
1127 1129
@@ -1162,7 +1164,7 @@ static void check_should_skip(struct cached_dev *dc, struct search *s)
1162 1164
1163 spin_lock(&dc->io_lock); 1165 spin_lock(&dc->io_lock);
1164 1166
1165 hlist_for_each_entry(i, iohash(bio->bi_sector), hash) 1167 hlist_for_each_entry(i, iohash(dc, bio->bi_sector), hash)
1166 if (i->last == bio->bi_sector && 1168 if (i->last == bio->bi_sector &&
1167 time_before(jiffies, i->jiffies)) 1169 time_before(jiffies, i->jiffies))
1168 goto found; 1170 goto found;
@@ -1180,7 +1182,7 @@ found:
1180 s->task->sequential_io = i->sequential; 1182 s->task->sequential_io = i->sequential;
1181 1183
1182 hlist_del(&i->hash); 1184 hlist_del(&i->hash);
1183 hlist_add_head(&i->hash, iohash(i->last)); 1185 hlist_add_head(&i->hash, iohash(dc, i->last));
1184 list_move_tail(&i->lru, &dc->io_lru); 1186 list_move_tail(&i->lru, &dc->io_lru);
1185 1187
1186 spin_unlock(&dc->io_lock); 1188 spin_unlock(&dc->io_lock);