dm snap persistent: simplify area_io()
authorQinglang Miao <miaoqinglang@huawei.com>
Mon, 21 Sep 2020 13:10:10 +0000 (21:10 +0800)
committerMike Snitzer <snitzer@redhat.com>
Tue, 29 Sep 2020 20:33:12 +0000 (16:33 -0400)
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-snap-persistent.c

index 63fab7c..8e329c3 100644 (file)
@@ -284,16 +284,9 @@ static void skip_metadata(struct pstore *ps)
  */
 static int area_io(struct pstore *ps, int op, int op_flags)
 {
-       int r;
-       chunk_t chunk;
-
-       chunk = area_location(ps, ps->current_area);
-
-       r = chunk_io(ps, ps->area, chunk, op, op_flags, 0);
-       if (r)
-               return r;
+       chunk_t chunk = area_location(ps, ps->current_area);
 
-       return 0;
+       return chunk_io(ps, ps->area, chunk, op, op_flags, 0);
 }
 
 static void zero_memory_area(struct pstore *ps)