~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/target/target_core_pr.c

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings, Bastian Blank, Ben Hutchings, Uwe Kleine-König
  • Date: 2012-03-04 15:32:20 UTC
  • mfrom: (1.3.14)
  • mto: This revision was merged to the branch mainline in revision 57.
  • Revision ID: package-import@ubuntu.com-20120304153220-zbhqnmufx18yk6q4
* New upstream stable update:
  http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.8
  - [i386] i387: move TS_USEDFPU flag from thread_info to task_struct
  - [x86] additional refactoring of FPU/SSE state save and restore
  http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.9
  - vfs: fix d_inode_lookup() dentry ref leak
  - target: Allow control CDBs with data > 1 page
  - epoll: introduce POLLFREE to flush ->signalfd_wqh before kfree()
  - epoll: ep_unregister_pollwait() can use the freed pwq->whead
  - epoll: limit paths (CVE-2011-1083)
  - cdrom: use copy_to_user() without the underscores

[ Bastian Blank ]
* [mips,mipsel] Also remove ext4 modules from installer.

[ Ben Hutchings ]
* Update debconf template translations:
  - Update Dutch (Willem Kuyn) (Closes: #658736)
  - Add Polish (Michał Kułach) (Closes: #658912)
* Bump ABI to 2
* fs: Introduce and enable security restrictions on links:
  - Do not follow symlinks in /tmp that are owned by other users
    (sysctl: fs.protected_symlinks)
  - Do not allow unprivileged users to create hard links to sensitive files
    (sysctl: fs.protected_hardlinks) (Closes: #609455)
    + This breaks the 'at' package in stable, which will be fixed shortly
      (see #597130)
  The precise restrictions are specified in Documentation/sysctl/fs.txt in
  the linux-doc-3.2 and linux-source-3.2 packages.
* iwlwifi: fix key removal (Closes: #651199)
* cgroups: Set CGROUP_PERF
* hid: Enable HID_HOLTEK, HID_PRIMAX, HID_SPEEDLINK, HID_WIIMOTE as modules,
  HID_ACRUX_FF
* media/rc: Enable RC_ATI_REMOTE as module
* gspca: Enable USB_GSPCA_TOPRO as module
* dvb-usb: Enable DVB_USB_PCTV452E, DVB_USB_MXL111SF as modules

[ Uwe Kleine-König ]
* [x86] Update rt featureset to 3.2.9-rt15

Show diffs side-by-side

added added

removed removed

Lines of Context:
1538
1538
        tidh_new->dest_local_nexus = 1;
1539
1539
        list_add_tail(&tidh_new->dest_list, &tid_dest_list);
1540
1540
 
1541
 
        buf = transport_kmap_first_data_page(cmd);
 
1541
        buf = transport_kmap_data_sg(cmd);
1542
1542
        /*
1543
1543
         * For a PERSISTENT RESERVE OUT specify initiator ports payload,
1544
1544
         * first extract TransportID Parameter Data Length, and make sure
1789
1789
 
1790
1790
        }
1791
1791
 
1792
 
        transport_kunmap_first_data_page(cmd);
 
1792
        transport_kunmap_data_sg(cmd);
1793
1793
 
1794
1794
        /*
1795
1795
         * Go ahead and create a registrations from tid_dest_list for the
1837
1837
 
1838
1838
        return 0;
1839
1839
out:
1840
 
        transport_kunmap_first_data_page(cmd);
 
1840
        transport_kunmap_data_sg(cmd);
1841
1841
        /*
1842
1842
         * For the failure case, release everything from tid_dest_list
1843
1843
         * including *dest_pr_reg and the configfs dependances..
3429
3429
         * will be moved to for the TransportID containing SCSI initiator WWN
3430
3430
         * information.
3431
3431
         */
3432
 
        buf = transport_kmap_first_data_page(cmd);
 
3432
        buf = transport_kmap_data_sg(cmd);
3433
3433
        rtpi = (buf[18] & 0xff) << 8;
3434
3434
        rtpi |= buf[19] & 0xff;
3435
3435
        tid_len = (buf[20] & 0xff) << 24;
3436
3436
        tid_len |= (buf[21] & 0xff) << 16;
3437
3437
        tid_len |= (buf[22] & 0xff) << 8;
3438
3438
        tid_len |= buf[23] & 0xff;
3439
 
        transport_kunmap_first_data_page(cmd);
 
3439
        transport_kunmap_data_sg(cmd);
3440
3440
        buf = NULL;
3441
3441
 
3442
3442
        if ((tid_len + 24) != cmd->data_length) {
3488
3488
                return -EINVAL;
3489
3489
        }
3490
3490
 
3491
 
        buf = transport_kmap_first_data_page(cmd);
 
3491
        buf = transport_kmap_data_sg(cmd);
3492
3492
        proto_ident = (buf[24] & 0x0f);
3493
3493
#if 0
3494
3494
        pr_debug("SPC-3 PR REGISTER_AND_MOVE: Extracted Protocol Identifier:"
3522
3522
                goto out;
3523
3523
        }
3524
3524
 
3525
 
        transport_kunmap_first_data_page(cmd);
 
3525
        transport_kunmap_data_sg(cmd);
3526
3526
        buf = NULL;
3527
3527
 
3528
3528
        pr_debug("SPC-3 PR [%s] Extracted initiator %s identifier: %s"
3787
3787
                                        " REGISTER_AND_MOVE\n");
3788
3788
        }
3789
3789
 
3790
 
        transport_kunmap_first_data_page(cmd);
 
3790
        transport_kunmap_data_sg(cmd);
3791
3791
 
3792
3792
        core_scsi3_put_pr_reg(dest_pr_reg);
3793
3793
        return 0;
3794
3794
out:
3795
3795
        if (buf)
3796
 
                transport_kunmap_first_data_page(cmd);
 
3796
                transport_kunmap_data_sg(cmd);
3797
3797
        if (dest_se_deve)
3798
3798
                core_scsi3_lunacl_undepend_item(dest_se_deve);
3799
3799
        if (dest_node_acl)
3867
3867
        scope = (cdb[2] & 0xf0);
3868
3868
        type = (cdb[2] & 0x0f);
3869
3869
 
3870
 
        buf = transport_kmap_first_data_page(cmd);
 
3870
        buf = transport_kmap_data_sg(cmd);
3871
3871
        /*
3872
3872
         * From PERSISTENT_RESERVE_OUT parameter list (payload)
3873
3873
         */
3885
3885
                aptpl = (buf[17] & 0x01);
3886
3886
                unreg = (buf[17] & 0x02);
3887
3887
        }
3888
 
        transport_kunmap_first_data_page(cmd);
 
3888
        transport_kunmap_data_sg(cmd);
3889
3889
        buf = NULL;
3890
3890
 
3891
3891
        /*
3985
3985
                return -EINVAL;
3986
3986
        }
3987
3987
 
3988
 
        buf = transport_kmap_first_data_page(cmd);
 
3988
        buf = transport_kmap_data_sg(cmd);
3989
3989
        buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff);
3990
3990
        buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff);
3991
3991
        buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff);
4019
4019
        buf[6] = ((add_len >> 8) & 0xff);
4020
4020
        buf[7] = (add_len & 0xff);
4021
4021
 
4022
 
        transport_kunmap_first_data_page(cmd);
 
4022
        transport_kunmap_data_sg(cmd);
4023
4023
 
4024
4024
        return 0;
4025
4025
}
4045
4045
                return -EINVAL;
4046
4046
        }
4047
4047
 
4048
 
        buf = transport_kmap_first_data_page(cmd);
 
4048
        buf = transport_kmap_data_sg(cmd);
4049
4049
        buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff);
4050
4050
        buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff);
4051
4051
        buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff);
4104
4104
 
4105
4105
err:
4106
4106
        spin_unlock(&se_dev->dev_reservation_lock);
4107
 
        transport_kunmap_first_data_page(cmd);
 
4107
        transport_kunmap_data_sg(cmd);
4108
4108
 
4109
4109
        return 0;
4110
4110
}
4128
4128
                return -EINVAL;
4129
4129
        }
4130
4130
 
4131
 
        buf = transport_kmap_first_data_page(cmd);
 
4131
        buf = transport_kmap_data_sg(cmd);
4132
4132
 
4133
4133
        buf[0] = ((add_len << 8) & 0xff);
4134
4134
        buf[1] = (add_len & 0xff);
4160
4160
        buf[4] |= 0x02; /* PR_TYPE_WRITE_EXCLUSIVE */
4161
4161
        buf[5] |= 0x01; /* PR_TYPE_EXCLUSIVE_ACCESS_ALLREG */
4162
4162
 
4163
 
        transport_kunmap_first_data_page(cmd);
 
4163
        transport_kunmap_data_sg(cmd);
4164
4164
 
4165
4165
        return 0;
4166
4166
}
4190
4190
                return -EINVAL;
4191
4191
        }
4192
4192
 
4193
 
        buf = transport_kmap_first_data_page(cmd);
 
4193
        buf = transport_kmap_data_sg(cmd);
4194
4194
 
4195
4195
        buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff);
4196
4196
        buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff);
4311
4311
        buf[6] = ((add_len >> 8) & 0xff);
4312
4312
        buf[7] = (add_len & 0xff);
4313
4313
 
4314
 
        transport_kunmap_first_data_page(cmd);
 
4314
        transport_kunmap_data_sg(cmd);
4315
4315
 
4316
4316
        return 0;
4317
4317
}