1. 03 5月, 2013 2 次提交
    • A
      rbd: use binary search for snapshot lookup · 30d1cff8
      Alex Elder 提交于
      Use bsearch(3) to make snapshot lookup by id more efficient.  (There
      could be thousands of snapshots, and conceivably many more.)
      Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      30d1cff8
    • A
      rbd: clear EXISTS flag if mapped snapshot disappears · 15228ede
      Alex Elder 提交于
      This functionality inadvertently disappeared in the last patch.
      
      Image snapshots can get removed at just about any time.  In
      particular it can disappear even if it is in use by an rbd
      client as a mapped image.
      
      The rbd client deals with such a disappearance by responding to new
      requests with ENXIO.  This is implemented by each rbd device
      maintaining an EXISTS flag, which is normally set but cleared if a
      snapshot disappears.
      
      This patch (re-)implements the clearing of that flag.
      
      Whenever mapped image header information is refreshed, if the
      mapping is for a snapshot, verify the mapped snapshot is still
      present in the updated snapshot context.  If it is not, clear the
      flag.
      
      It is not necessary to check this in the initial probe, because the
      probe will not succeed if the snapshot doesn't exist.
      
      This resolves:
          http://tracker.ceph.com/issues/4880Signed-off-by: NAlex Elder <elder@inktank.com>
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      15228ede
  2. 02 5月, 2013 38 次提交