diff options
author | Christoph Hellwig <hch@lst.de> | 2015-10-05 09:31:10 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-11-01 03:48:28 +0100 |
commit | 22581f58ed3f0c9eb066d67b696b66f951df5c2b (patch) | |
tree | 6d5f7eefd3f6641419d8c354807db63a1e2b259f /drivers/md/raid5-cache.c | |
parent | raid5-cache: simplify state machine when caches flushes are not needed (diff) | |
download | linux-22581f58ed3f0c9eb066d67b696b66f951df5c2b.tar.xz linux-22581f58ed3f0c9eb066d67b696b66f951df5c2b.zip |
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>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r-- | drivers/md/raid5-cache.c | 12 |
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) 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; } |