aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-10-05 03:31:10 -0400
committerNeilBrown <neilb@suse.com>2015-10-31 22:48:28 -0400
commit22581f58ed3f0c9eb066d67b696b66f951df5c2b (patch)
tree6d5f7eefd3f6641419d8c354807db63a1e2b259f
parent56fef7c6e02493dce316de99a11e9e26b852218b (diff)
raid5-cache: clean up r5l_get_meta
Remove the only partially used local 'io' variable to simplify the code flow. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
-rw-r--r--drivers/md/raid5-cache.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index a7ee7ec89f4f..29db786557d9 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -322,16 +322,12 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log)
322 322
323static int r5l_get_meta(struct r5l_log *log, unsigned int payload_size) 323static int r5l_get_meta(struct r5l_log *log, unsigned int payload_size)
324{ 324{
325 struct r5l_io_unit *io; 325 if (log->current_io &&
326 326 log->current_io->meta_offset + payload_size > PAGE_SIZE)
327 io = log->current_io;
328 if (io && io->meta_offset + payload_size > PAGE_SIZE)
329 r5l_submit_current_io(log); 327 r5l_submit_current_io(log);
330 io = log->current_io;
331 if (io)
332 return 0;
333 328
334 log->current_io = r5l_new_meta(log); 329 if (!log->current_io)
330 log->current_io = r5l_new_meta(log);
335 return 0; 331 return 0;
336} 332}
337 333