1. 02 10月, 2012 3 次提交
    • A
      rbd: ensure invalid pointers are made null · d78fd7ae
      Alex Elder 提交于
      Fix a number of spots where a pointer value that is known to
      have become invalid but was not reset to null.
      
      Also, toss in a change so we use sizeof (object) rather than
      sizeof (type).
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      d78fd7ae
    • A
      rbd: make snap_names_len a u64 · 0f1d3f93
      Alex Elder 提交于
      The snap_names_len field of an rbd_image_header structure is defined
      with type size_t.  That field is used as both the source and target
      of 64-bit byte-order swapping operations though, so it's best to
      define it with type u64 instead.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      0f1d3f93
    • A
      rbd: simplify __rbd_init_snaps_header() · 35938150
      Alex Elder 提交于
      The purpose of __rbd_init_snaps_header() is to compare a new
      snapshot context with an rbd device's list of existing snapshots.
      It updates the list by adding any new snapshots or removing any
      that are not present in the new snapshot context.
      
      The code as written is a little confusing, because it traverses both
      the existing snapshot list and the set of snapshots in the snapshot
      context in reverse.  This was done based on an assumption about
      snapshots that is not true--namely that a duplicate snapshot name
      could cause an error in intepreting things if they were not
      processed in ascending order.
      
      These precautions are not necessary, because:
          - all snapshots are uniquely identified by their snapshot id
          - a new snapshot cannot be created if the rbd device has another
            snapshot with the same name
      (It is furthermore not currently possible to rename a snapshot.)
      
      This patch re-implements __rbd_init_snaps_header() so it passes
      through both the existing snapshot list and the entries in the
      snapshot context in forward order.  It still does the same thing
      as before, but I find the logic considerably easier to understand.
      
      By going forward through the names in the snapshot context, there
      is no longer a need for the rbd_prev_snap_name() helper function.
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      35938150
  2. 22 9月, 2012 1 次提交
  3. 31 7月, 2012 36 次提交