~ubuntu-branches/ubuntu/wily/linux-ti-omap4/wily

« back to all changes in this revision

Viewing changes to drivers/block/cciss.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2013-07-11 18:35:20 UTC
  • Revision ID: package-import@ubuntu.com-20130711183520-htnf1x4y5r11hndr
Tags: 3.5.0-229.42
* Release Tracking Bug
  - LP: #1199276

[ Paolo Pisati ]

* [Config] CONFIG_ATH9K_LEGACY_RATE_CONTROL is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
static int cciss_open(struct block_device *bdev, fmode_t mode);
162
162
static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode);
163
163
static int cciss_release(struct gendisk *disk, fmode_t mode);
164
 
static int do_ioctl(struct block_device *bdev, fmode_t mode,
165
 
                    unsigned int cmd, unsigned long arg);
166
164
static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
167
165
                       unsigned int cmd, unsigned long arg);
168
166
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,
1140
1138
        return 0;
1141
1139
}
1142
1140
 
1143
 
static int do_ioctl(struct block_device *bdev, fmode_t mode,
1144
 
                    unsigned cmd, unsigned long arg)
1145
 
{
1146
 
        int ret;
1147
 
        mutex_lock(&cciss_mutex);
1148
 
        ret = cciss_ioctl(bdev, mode, cmd, arg);
1149
 
        mutex_unlock(&cciss_mutex);
1150
 
        return ret;
1151
 
}
1152
 
 
1153
1141
#ifdef CONFIG_COMPAT
1154
1142
 
1155
1143
static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
1176
1164
        case CCISS_REGNEWD:
1177
1165
        case CCISS_RESCANDISK:
1178
1166
        case CCISS_GETLUNINFO:
1179
 
                return do_ioctl(bdev, mode, cmd, arg);
 
1167
                return cciss_ioctl(bdev, mode, cmd, arg);
1180
1168
 
1181
1169
        case CCISS_PASSTHRU32:
1182
1170
                return cciss_ioctl32_passthru(bdev, mode, cmd, arg);
1216
1204
        if (err)
1217
1205
                return -EFAULT;
1218
1206
 
1219
 
        err = do_ioctl(bdev, mode, CCISS_PASSTHRU, (unsigned long)p);
 
1207
        err = cciss_ioctl(bdev, mode, CCISS_PASSTHRU, (unsigned long)p);
1220
1208
        if (err)
1221
1209
                return err;
1222
1210
        err |=
1258
1246
        if (err)
1259
1247
                return -EFAULT;
1260
1248
 
1261
 
        err = do_ioctl(bdev, mode, CCISS_BIG_PASSTHRU, (unsigned long)p);
 
1249
        err = cciss_ioctl(bdev, mode, CCISS_BIG_PASSTHRU, (unsigned long)p);
1262
1250
        if (err)
1263
1251
                return err;
1264
1252
        err |=
1308
1296
static int cciss_getintinfo(ctlr_info_t *h, void __user *argp)
1309
1297
{
1310
1298
        cciss_coalint_struct intinfo;
 
1299
        unsigned long flags;
1311
1300
 
1312
1301
        if (!argp)
1313
1302
                return -EINVAL;
 
1303
        spin_lock_irqsave(&h->lock, flags);
1314
1304
        intinfo.delay = readl(&h->cfgtable->HostWrite.CoalIntDelay);
1315
1305
        intinfo.count = readl(&h->cfgtable->HostWrite.CoalIntCount);
 
1306
        spin_unlock_irqrestore(&h->lock, flags);
1316
1307
        if (copy_to_user
1317
1308
            (argp, &intinfo, sizeof(cciss_coalint_struct)))
1318
1309
                return -EFAULT;
1353
1344
static int cciss_getnodename(ctlr_info_t *h, void __user *argp)
1354
1345
{
1355
1346
        NodeName_type NodeName;
 
1347
        unsigned long flags;
1356
1348
        int i;
1357
1349
 
1358
1350
        if (!argp)
1359
1351
                return -EINVAL;
 
1352
        spin_lock_irqsave(&h->lock, flags);
1360
1353
        for (i = 0; i < 16; i++)
1361
1354
                NodeName[i] = readb(&h->cfgtable->ServerName[i]);
 
1355
        spin_unlock_irqrestore(&h->lock, flags);
1362
1356
        if (copy_to_user(argp, NodeName, sizeof(NodeName_type)))
1363
1357
                return -EFAULT;
1364
1358
        return 0;
1395
1389
static int cciss_getheartbeat(ctlr_info_t *h, void __user *argp)
1396
1390
{
1397
1391
        Heartbeat_type heartbeat;
 
1392
        unsigned long flags;
1398
1393
 
1399
1394
        if (!argp)
1400
1395
                return -EINVAL;
 
1396
        spin_lock_irqsave(&h->lock, flags);
1401
1397
        heartbeat = readl(&h->cfgtable->HeartBeat);
 
1398
        spin_unlock_irqrestore(&h->lock, flags);
1402
1399
        if (copy_to_user(argp, &heartbeat, sizeof(Heartbeat_type)))
1403
1400
                return -EFAULT;
1404
1401
        return 0;
1407
1404
static int cciss_getbustypes(ctlr_info_t *h, void __user *argp)
1408
1405
{
1409
1406
        BusTypes_type BusTypes;
 
1407
        unsigned long flags;
1410
1408
 
1411
1409
        if (!argp)
1412
1410
                return -EINVAL;
 
1411
        spin_lock_irqsave(&h->lock, flags);
1413
1412
        BusTypes = readl(&h->cfgtable->BusTypes);
 
1413
        spin_unlock_irqrestore(&h->lock, flags);
1414
1414
        if (copy_to_user(argp, &BusTypes, sizeof(BusTypes_type)))
1415
1415
                return -EFAULT;
1416
1416
        return 0;