1. 23 3月, 2013 4 次提交
    • L
      drbd: use the cached meta_dev_idx · 68e41a43
      Lars Ellenberg 提交于
      Now we have the cached meta_dev_idx member,
      we can get rid of a few rcu_read_lock() sections and rcu_dereference().
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      68e41a43
    • L
      drbd: prepare for new striped layout of activity log · 3a4d4eb3
      Lars Ellenberg 提交于
      Introduce two new on-disk meta data fields: al_stripes and al_stripe_size_4k
      The intended use case is activity log on RAID 0 or similar.
      Logically consecutive transactions will advance their on-disk position
      by al_stripe_size_4k 4kB (transaction sized) blocks.
      
      Right now, these are still asserted to be the backward compatible
      values al_stripes = 1, al_stripe_size_4k = 8 (which amounts to 32kB).
      
      Also introduce a caching member for meta_dev_idx in the in-core
      structure: even though it is initially passed in in the rcu-protected
      disk_conf structure, it cannot change without a detach/attach cycle.
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      3a4d4eb3
    • L
      drbd: cleanup ondisk meta data layout calculations and defines · ae8bf312
      Lars Ellenberg 提交于
      Add a comment about our meta data layout variants,
      and rename a few defines (e.g. MD_RESERVED_SECT -> MD_128MB_SECT)
      to make it clear that they are short hand for fixed constants,
      and not arbitrarily to be redefined as one may see fit.
      
      Properly pad struct meta_data_on_disk to 4kB,
      and initialize to zero not only the first 512 Byte,
      but all of it in drbd_md_sync().
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ae8bf312
    • L
      drbd: cleanup bogus assert message · 9114d795
      Lars Ellenberg 提交于
      This fixes ASSERT( mdev->state.disk == D_FAILED ) in drivers/block/drbd/drbd_main.c
      
      When we detach from local disk, we let the local refcount hit zero twice.
      
      First, we transition to D_FAILED, so we won't give out new references
      to incoming requests; we still may give out *internal* references, though.
      Once the refcount hits zero [1] while in D_FAILED, we queue a transition
      to D_DISKLESS to our worker.  We need to queue it, because we may be in
      atomic context when putting the reference.
      Once the transition to D_DISKLESS actually happened [2] from worker context,
      we don't give out new internal references either.
      
      Between hitting zero the first time [1] and actually transition to
      D_DISKLESS [2], there may be a few very short lived internal get/put,
      so we may hit zero more than once while being in D_FAILED, or even see a
      race where a an internal get_ldev() happened while D_FAILED, but the
      corresponding put_ldev() happens just after the transition to D_DISKLESS.
      
      That's why we have the additional test_and_set_bit(GO_DISKLESS,);
      and that's why the assert was placed wrong.
      Since there was exactly one code path left to drbd_go_diskless(),
      and that checks already for D_FAILED, drop that assert,
      and fold in the drbd_queue_work().
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9114d795
  2. 01 12月, 2012 1 次提交
    • J
      drbd: fixup after wait_even_lock_irq() addition to generic code · 2cecb730
      Jens Axboe 提交于
      Compiling drbd yields:
      
      drivers/block/drbd/drbd_state.c: In function ‘_conn_request_state’:
      drivers/block/drbd/drbd_state.c:1804:5: error: macro "wait_event_lock_irq" passed 4 arguments, but takes just 3
      drivers/block/drbd/drbd_state.c:1801:3: error: ‘wait_event_lock_irq’ undeclared (first use in this function)
      drivers/block/drbd/drbd_state.c:1801:3: note: each undeclared identifier is reported only once for each function it appears in
      drivers/block/drbd/drbd_state.c: At top level:
      drivers/block/drbd/drbd_state.c:1734:1: warning: ‘_conn_rq_cond’ defined but not used [-Wunused-function]
      
      Due to drbd having copied the MD definition for wait_event_lock_irq()
      as well. Kill them.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      2cecb730
  3. 09 11月, 2012 14 次提交
  4. 08 11月, 2012 21 次提交