raid5-cache: clean up r5l_get_meta
authorChristoph Hellwig <hch@lst.de>
Mon, 5 Oct 2015 07:31:10 +0000 (09:31 +0200)
committerNeilBrown <neilb@suse.com>
Sun, 1 Nov 2015 02:48:28 +0000 (13:48 +1100)
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>
drivers/md/raid5-cache.c

index a7ee7ec89f4f1a7111d24d232c99660a65e85ed2..29db786557d98a01dd4930e4fa07114a9e939e12 100644 (file)
@@ -322,16 +322,12 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log)
 
 static int r5l_get_meta(struct r5l_log *log, unsigned int payload_size)
 {
-       struct r5l_io_unit *io;
-
-       io = log->current_io;
-       if (io && io->meta_offset + payload_size > PAGE_SIZE)
+       if (log->current_io &&
+           log->current_io->meta_offset + payload_size > PAGE_SIZE)
                r5l_submit_current_io(log);
-       io = log->current_io;
-       if (io)
-               return 0;
 
-       log->current_io = r5l_new_meta(log);
+       if (!log->current_io)
+               log->current_io = r5l_new_meta(log);
        return 0;
 }