aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-08-26 14:55:49 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:12:31 -0400
commit252161094255ffdc277b8a0e5e12b0a8ff67b10f (patch)
tree875117a8c576bd2bfea5504f635312b1b9041383 /drivers/block/cciss.c
parent4c800eed9a46f7b6a469d24e7e6051b23e62bb69 (diff)
cciss: factor out cciss_getnodename
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 5119c8837cf5..9a3dd20ea93a 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1291,6 +1291,20 @@ static int cciss_setintinfo(ctlr_info_t *h, void __user *argp)
1291 return 0; 1291 return 0;
1292} 1292}
1293 1293
1294static int cciss_getnodename(ctlr_info_t *h, void __user *argp)
1295{
1296 NodeName_type NodeName;
1297 int i;
1298
1299 if (!argp)
1300 return -EINVAL;
1301 for (i = 0; i < 16; i++)
1302 NodeName[i] = readb(&h->cfgtable->ServerName[i]);
1303 if (copy_to_user(argp, NodeName, sizeof(NodeName_type)))
1304 return -EFAULT;
1305 return 0;
1306}
1307
1294static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1308static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1295 unsigned int cmd, unsigned long arg) 1309 unsigned int cmd, unsigned long arg)
1296{ 1310{
@@ -1309,19 +1323,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1309 case CCISS_SETINTINFO: 1323 case CCISS_SETINTINFO:
1310 return cciss_setintinfo(h, argp); 1324 return cciss_setintinfo(h, argp);
1311 case CCISS_GETNODENAME: 1325 case CCISS_GETNODENAME:
1312 { 1326 return cciss_getnodename(h, argp);
1313 NodeName_type NodeName;
1314 int i;
1315
1316 if (!arg)
1317 return -EINVAL;
1318 for (i = 0; i < 16; i++)
1319 NodeName[i] =
1320 readb(&h->cfgtable->ServerName[i]);
1321 if (copy_to_user(argp, NodeName, sizeof(NodeName_type)))
1322 return -EFAULT;
1323 return 0;
1324 }
1325 case CCISS_SETNODENAME: 1327 case CCISS_SETNODENAME:
1326 { 1328 {
1327 NodeName_type NodeName; 1329 NodeName_type NodeName;