return NULL;
}
- pr_reg->pr_aptpl_buf = kzalloc(dev->t10_pr.pr_aptpl_buf_len,
- GFP_ATOMIC);
+ pr_reg->pr_aptpl_buf = kzalloc(PR_APTPL_BUF_LEN, GFP_ATOMIC);
if (!pr_reg->pr_aptpl_buf) {
pr_err("Unable to allocate pr_reg->pr_aptpl_buf\n");
kmem_cache_free(t10_pr_reg_cache, pr_reg);
pr_err("Unable to allocate struct t10_pr_registration\n");
return -ENOMEM;
}
- pr_reg->pr_aptpl_buf = kzalloc(pr_tmpl->pr_aptpl_buf_len, GFP_KERNEL);
+ pr_reg->pr_aptpl_buf = kzalloc(PR_APTPL_BUF_LEN, GFP_KERNEL);
INIT_LIST_HEAD(&pr_reg->pr_reg_list);
INIT_LIST_HEAD(&pr_reg->pr_reg_abort_list);
se_sess->se_node_acl, se_sess);
if (core_scsi3_update_and_write_aptpl(cmd->se_dev,
- &pr_reg->pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ pr_reg->pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_tmpl->pr_aptpl_active = 1;
pr_debug("SPC-3 PR: Set APTPL Bit Activated for REGISTER\n");
}
* Allocate APTPL metadata buffer used for UNREGISTER ops
*/
if (aptpl) {
- pr_aptpl_buf = kzalloc(pr_tmpl->pr_aptpl_buf_len,
- GFP_KERNEL);
+ pr_aptpl_buf = kzalloc(PR_APTPL_BUF_LEN, GFP_KERNEL);
if (!pr_aptpl_buf) {
pr_err("Unable to allocate"
" pr_aptpl_buf\n");
return 0;
}
- if (!core_scsi3_update_and_write_aptpl(dev, &pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ if (!core_scsi3_update_and_write_aptpl(dev, pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_tmpl->pr_aptpl_active = 1;
pr_debug("SPC-3 PR: Set APTPL Bit Activated"
" for UNREGISTER\n");
goto out_put_pr_reg;
}
- if (!core_scsi3_update_and_write_aptpl(dev, &pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ if (!core_scsi3_update_and_write_aptpl(dev, pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_tmpl->pr_aptpl_active = 1;
pr_debug("SPC-3 PR: Set APTPL Bit Activated"
" for REGISTER\n");
if (pr_tmpl->pr_aptpl_active) {
if (!core_scsi3_update_and_write_aptpl(cmd->se_dev,
- &pr_reg->pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ pr_reg->pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_debug("SPC-3 PR: Updated APTPL metadata"
" for RESERVE\n");
}
write_aptpl:
if (pr_tmpl->pr_aptpl_active) {
if (!core_scsi3_update_and_write_aptpl(cmd->se_dev,
- &pr_reg->pr_aptpl_buf[0], pr_tmpl->pr_aptpl_buf_len)) {
+ pr_reg->pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_debug("SPC-3 PR: Updated APTPL metadata for RELEASE\n");
}
}
if (pr_tmpl->pr_aptpl_active) {
if (!core_scsi3_update_and_write_aptpl(cmd->se_dev,
- &pr_reg_n->pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ pr_reg_n->pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_debug("SPC-3 PR: Updated APTPL"
" metadata for PREEMPT%s\n", (preempt_type == PREEMPT_AND_ABORT) ?
"_AND_ABORT" : "");
if (pr_tmpl->pr_aptpl_active) {
if (!core_scsi3_update_and_write_aptpl(cmd->se_dev,
- &pr_reg_n->pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ pr_reg_n->pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_debug("SPC-3 PR: Updated APTPL metadata for PREEMPT"
"%s\n", (preempt_type == PREEMPT_AND_ABORT) ? "_AND_ABORT" : "");
}
} else {
pr_tmpl->pr_aptpl_active = 1;
if (!core_scsi3_update_and_write_aptpl(cmd->se_dev,
- &dest_pr_reg->pr_aptpl_buf[0],
- pr_tmpl->pr_aptpl_buf_len)) {
+ dest_pr_reg->pr_aptpl_buf, PR_APTPL_BUF_LEN)) {
pr_debug("SPC-3 PR: Set APTPL Bit Activated for"
" REGISTER_AND_MOVE\n");
}