mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
ABT_DETAILS="x86_64"
|
||||
ABT_JOBS=5
|
||||
ABT_KERNELS=" \
|
||||
4.2.1 \
|
||||
4.1.8-nc \
|
||||
4.2.2 \
|
||||
4.1.9-nc \
|
||||
4.0.9-nc \
|
||||
3.19.7-nc \
|
||||
3.18.19-nc \
|
||||
|
||||
@@ -3375,8 +3375,6 @@ struct scst_acg {
|
||||
/* One more than the number of sessions in acg_sess_list */
|
||||
struct kref acg_kref;
|
||||
|
||||
struct work_struct put_work;
|
||||
|
||||
/* Owner target */
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
|
||||
@@ -4436,7 +4436,6 @@ struct scst_acg *scst_alloc_add_acg(struct scst_tgt *tgt,
|
||||
}
|
||||
|
||||
kref_init(&acg->acg_kref);
|
||||
INIT_WORK(&acg->put_work, scst_put_acg_work);
|
||||
acg->tgt = tgt;
|
||||
INIT_LIST_HEAD(&acg->acg_dev_list);
|
||||
INIT_LIST_HEAD(&acg->acg_sess_list);
|
||||
@@ -4580,20 +4579,39 @@ static void scst_release_acg(struct kref *kref)
|
||||
scst_free_acg(acg);
|
||||
}
|
||||
|
||||
struct scst_acg_put_work {
|
||||
struct work_struct work;
|
||||
struct scst_acg *acg;
|
||||
};
|
||||
|
||||
static void scst_put_acg_work(struct work_struct *work)
|
||||
{
|
||||
struct scst_acg *acg = container_of(work, typeof(*acg), put_work);
|
||||
struct scst_acg_put_work *put_work =
|
||||
container_of(work, typeof(*put_work), work);
|
||||
struct scst_acg *acg = put_work->acg;
|
||||
|
||||
kfree(work);
|
||||
kref_put(&acg->acg_kref, scst_release_acg);
|
||||
}
|
||||
|
||||
void scst_put_acg(struct scst_acg *acg)
|
||||
{
|
||||
struct scst_acg_put_work *put_work;
|
||||
|
||||
put_work = kmalloc(sizeof(*put_work), GFP_KERNEL | __GFP_NOFAIL);
|
||||
if (WARN_ON_ONCE(!put_work)) {
|
||||
kref_put(&acg->acg_kref, scst_release_acg);
|
||||
return;
|
||||
}
|
||||
|
||||
INIT_WORK(&put_work->work, scst_put_acg_work);
|
||||
put_work->acg = acg;
|
||||
|
||||
/*
|
||||
* Schedule the kref_put() call instead of invoking it directly to
|
||||
* avoid deep recursion and a stack overflow.
|
||||
*/
|
||||
queue_work(scst_release_acg_wq, &acg->put_work);
|
||||
WARN_ON_ONCE(!queue_work(scst_release_acg_wq, &put_work->work));
|
||||
}
|
||||
|
||||
void scst_get_acg(struct scst_acg *acg)
|
||||
|
||||
Reference in New Issue
Block a user