]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: do some refactoring
authorAlex Elder <elder@dreamhost.com>
Tue, 7 Feb 2012 18:03:36 +0000 (12:03 -0600)
committerAlex Elder <elder@dreamhost.com>
Thu, 22 Mar 2012 15:47:50 +0000 (10:47 -0500)
commit40f7d508ace21e0384790b07306ad171e050af47
tree573bed76392a12b4568adcf704ec7b77e108be08
parent9f7b4dd333956eaea4366d8e7db88cd9d2b3f5f6
rbd: do some refactoring

A few blocks of code are rearranged a bit here:
    - In rbd_header_from_disk():
- Don't bother computing snap_count until we're sure the
  on-disk header starts with a good signature.
- Move a few independent lines of code so they are *after* a
  check for a failed memory allocation.
- Get rid of unnecessary local variable "ret".
    - Make a few other changes in rbd_read_header(), similar to the
      above--just moving things around a bit while preserving the
      functionality.
    - In rbd_rq_fn(), just assign rq in the while loop's controlling
      expression rather than duplicating it before and at the end of
      the loop body.  This allows the use of "continue" rather than
      "goto next" in a number of spots.
    - Rearrange the logic in snap_by_name().  End result is the same.

Signed-off-by: Alex Elder <elder@dreamhost.com>
drivers/block/rbd.c