]> 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)
commit5dc45a3cfd2b6b05a4d99f4530ba747ffcc16b81
tree573bed76392a12b4568adcf704ec7b77e108be08
parent9719c7d9ac0f355e19629a585d945bdc5e5cbd06
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