Ignore:
Timestamp:
Mar 15, 2017, 2:42:58 AM (2 months ago)
Author:
brainslayer
Message:

use new squashfs in all kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.4/drivers/target/target_core_transport.c

    r31632 r31662  
    26812681EXPORT_SYMBOL(target_wait_for_sess_cmds);
    26822682
     2683static void target_lun_confirm(struct percpu_ref *ref)
     2684{
     2685        struct se_lun *lun = container_of(ref, struct se_lun, lun_ref);
     2686
     2687        complete(&lun->lun_ref_comp);
     2688}
     2689
    26832690void transport_clear_lun_ref(struct se_lun *lun)
    26842691{
    2685         percpu_ref_kill(&lun->lun_ref);
     2692        /*
     2693         * Mark the percpu-ref as DEAD, switch to atomic_t mode, drop
     2694         * the initial reference and schedule confirm kill to be
     2695         * executed after one full RCU grace period has completed.
     2696         */
     2697        percpu_ref_kill_and_confirm(&lun->lun_ref, target_lun_confirm);
     2698        /*
     2699         * The first completion waits for percpu_ref_switch_to_atomic_rcu()
     2700         * to call target_lun_confirm after lun->lun_ref has been marked
     2701         * as __PERCPU_REF_DEAD on all CPUs, and switches to atomic_t
     2702         * mode so that percpu_ref_tryget_live() lookup of lun->lun_ref
     2703         * fails for all new incoming I/O.
     2704         */
    26862705        wait_for_completion(&lun->lun_ref_comp);
     2706        /*
     2707         * The second completion waits for percpu_ref_put_many() to
     2708         * invoke ->release() after lun->lun_ref has switched to
     2709         * atomic_t mode, and lun->lun_ref.count has reached zero.
     2710         *
     2711         * At this point all target-core lun->lun_ref references have
     2712         * been dropped via transport_lun_remove_cmd(), and it's safe
     2713         * to proceed with the remaining LUN shutdown.
     2714         */
     2715        wait_for_completion(&lun->lun_shutdown_comp);
    26872716}
    26882717
Note: See TracChangeset for help on using the changeset viewer.