~ubuntu-branches/ubuntu/precise/linux-lts-raring/precise-proposed

« back to all changes in this revision

Viewing changes to drivers/block/cciss.c

  • Committer: Package Import Robot
  • Author(s): Brad Figg, Brad Figg
  • Date: 2013-07-08 16:06:32 UTC
  • Revision ID: package-import@ubuntu.com-20130708160632-4v4dxvoo3oi1nihu
Tags: 3.8.0-27.40~precise1
[Brad Figg]

* Release Tracking Bug
  - LP: #1199255

[Brad Figg]

* UBUNTU: [Config] CONFIG_ARM_ERRATA_643719=y

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
static int cciss_open(struct block_device *bdev, fmode_t mode);
163
163
static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode);
164
164
static int cciss_release(struct gendisk *disk, fmode_t mode);
165
 
static int do_ioctl(struct block_device *bdev, fmode_t mode,
166
 
                    unsigned int cmd, unsigned long arg);
167
165
static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
168
166
                       unsigned int cmd, unsigned long arg);
169
167
static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo);
229
227
        .owner = THIS_MODULE,
230
228
        .open = cciss_unlocked_open,
231
229
        .release = cciss_release,
232
 
        .ioctl = do_ioctl,
 
230
        .ioctl = cciss_ioctl,
233
231
        .getgeo = cciss_getgeo,
234
232
#ifdef CONFIG_COMPAT
235
233
        .compat_ioctl = cciss_compat_ioctl,
1138
1136
        return 0;
1139
1137
}
1140
1138
 
1141
 
static int do_ioctl(struct block_device *bdev, fmode_t mode,
1142
 
                    unsigned cmd, unsigned long arg)
1143
 
{
1144
 
        int ret;
1145
 
        mutex_lock(&cciss_mutex);
1146
 
        ret = cciss_ioctl(bdev, mode, cmd, arg);
1147
 
        mutex_unlock(&cciss_mutex);
1148
 
        return ret;
1149
 
}
1150
 
 
1151
1139
#ifdef CONFIG_COMPAT
1152
1140
 
1153
1141
static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
1174
1162
        case CCISS_REGNEWD:
1175
1163
        case CCISS_RESCANDISK:
1176
1164
        case CCISS_GETLUNINFO:
1177
 
                return do_ioctl(bdev, mode, cmd, arg);
 
1165
                return cciss_ioctl(bdev, mode, cmd, arg);
1178
1166
 
1179
1167
        case CCISS_PASSTHRU32:
1180
1168
                return cciss_ioctl32_passthru(bdev, mode, cmd, arg);
1214
1202
        if (err)
1215
1203
                return -EFAULT;
1216
1204
 
1217
 
        err = do_ioctl(bdev, mode, CCISS_PASSTHRU, (unsigned long)p);
 
1205
        err = cciss_ioctl(bdev, mode, CCISS_PASSTHRU, (unsigned long)p);
1218
1206
        if (err)
1219
1207
                return err;
1220
1208
        err |=
1256
1244
        if (err)
1257
1245
                return -EFAULT;
1258
1246
 
1259
 
        err = do_ioctl(bdev, mode, CCISS_BIG_PASSTHRU, (unsigned long)p);
 
1247
        err = cciss_ioctl(bdev, mode, CCISS_BIG_PASSTHRU, (unsigned long)p);
1260
1248
        if (err)
1261
1249
                return err;
1262
1250
        err |=
1306
1294
static int cciss_getintinfo(ctlr_info_t *h, void __user *argp)
1307
1295
{
1308
1296
        cciss_coalint_struct intinfo;
 
1297
        unsigned long flags;
1309
1298
 
1310
1299
        if (!argp)
1311
1300
                return -EINVAL;
 
1301
        spin_lock_irqsave(&h->lock, flags);
1312
1302
        intinfo.delay = readl(&h->cfgtable->HostWrite.CoalIntDelay);
1313
1303
        intinfo.count = readl(&h->cfgtable->HostWrite.CoalIntCount);
 
1304
        spin_unlock_irqrestore(&h->lock, flags);
1314
1305
        if (copy_to_user
1315
1306
            (argp, &intinfo, sizeof(cciss_coalint_struct)))
1316
1307
                return -EFAULT;
1351
1342
static int cciss_getnodename(ctlr_info_t *h, void __user *argp)
1352
1343
{
1353
1344
        NodeName_type NodeName;
 
1345
        unsigned long flags;
1354
1346
        int i;
1355
1347
 
1356
1348
        if (!argp)
1357
1349
                return -EINVAL;
 
1350
        spin_lock_irqsave(&h->lock, flags);
1358
1351
        for (i = 0; i < 16; i++)
1359
1352
                NodeName[i] = readb(&h->cfgtable->ServerName[i]);
 
1353
        spin_unlock_irqrestore(&h->lock, flags);
1360
1354
        if (copy_to_user(argp, NodeName, sizeof(NodeName_type)))
1361
1355
                return -EFAULT;
1362
1356
        return 0;
1393
1387
static int cciss_getheartbeat(ctlr_info_t *h, void __user *argp)
1394
1388
{
1395
1389
        Heartbeat_type heartbeat;
 
1390
        unsigned long flags;
1396
1391
 
1397
1392
        if (!argp)
1398
1393
                return -EINVAL;
 
1394
        spin_lock_irqsave(&h->lock, flags);
1399
1395
        heartbeat = readl(&h->cfgtable->HeartBeat);
 
1396
        spin_unlock_irqrestore(&h->lock, flags);
1400
1397
        if (copy_to_user(argp, &heartbeat, sizeof(Heartbeat_type)))
1401
1398
                return -EFAULT;
1402
1399
        return 0;
1405
1402
static int cciss_getbustypes(ctlr_info_t *h, void __user *argp)
1406
1403
{
1407
1404
        BusTypes_type BusTypes;
 
1405
        unsigned long flags;
1408
1406
 
1409
1407
        if (!argp)
1410
1408
                return -EINVAL;
 
1409
        spin_lock_irqsave(&h->lock, flags);
1411
1410
        BusTypes = readl(&h->cfgtable->BusTypes);
 
1411
        spin_unlock_irqrestore(&h->lock, flags);
1412
1412
        if (copy_to_user(argp, &BusTypes, sizeof(BusTypes_type)))
1413
1413
                return -EFAULT;
1414
1414
        return 0;