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

use new squashfs in all kernels

File:
1 edited

Legend:

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

    r31574 r31662  
    27032703EXPORT_SYMBOL(target_wait_for_sess_cmds);
    27042704
     2705static void target_lun_confirm(struct percpu_ref *ref)
     2706{
     2707        struct se_lun *lun = container_of(ref, struct se_lun, lun_ref);
     2708
     2709        complete(&lun->lun_ref_comp);
     2710}
     2711
    27052712void transport_clear_lun_ref(struct se_lun *lun)
    27062713{
    2707         percpu_ref_kill(&lun->lun_ref);
     2714        /*
     2715         * Mark the percpu-ref as DEAD, switch to atomic_t mode, drop
     2716         * the initial reference and schedule confirm kill to be
     2717         * executed after one full RCU grace period has completed.
     2718         */
     2719        percpu_ref_kill_and_confirm(&lun->lun_ref, target_lun_confirm);
     2720        /*
     2721         * The first completion waits for percpu_ref_switch_to_atomic_rcu()
     2722         * to call target_lun_confirm after lun->lun_ref has been marked
     2723         * as __PERCPU_REF_DEAD on all CPUs, and switches to atomic_t
     2724         * mode so that percpu_ref_tryget_live() lookup of lun->lun_ref
     2725         * fails for all new incoming I/O.
     2726         */
    27082727        wait_for_completion(&lun->lun_ref_comp);
     2728        /*
     2729         * The second completion waits for percpu_ref_put_many() to
     2730         * invoke ->release() after lun->lun_ref has switched to
     2731         * atomic_t mode, and lun->lun_ref.count has reached zero.
     2732         *
     2733         * At this point all target-core lun->lun_ref references have
     2734         * been dropped via transport_lun_remove_cmd(), and it's safe
     2735         * to proceed with the remaining LUN shutdown.
     2736         */
     2737        wait_for_completion(&lun->lun_shutdown_comp);
    27092738}
    27102739
Note: See TracChangeset for help on using the changeset viewer.