diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-08-26 22:55:49 +0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 14:12:31 +0400 |
commit | 252161094255ffdc277b8a0e5e12b0a8ff67b10f (patch) | |
tree | 875117a8c576bd2bfea5504f635312b1b9041383 /drivers/block/cciss.c | |
parent | 4c800eed9a46f7b6a469d24e7e6051b23e62bb69 (diff) | |
download | linux-252161094255ffdc277b8a0e5e12b0a8ff67b10f.tar.xz |
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.c | 28 |
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) return 0; } +static int cciss_getnodename(ctlr_info_t *h, void __user *argp) +{ + NodeName_type NodeName; + int i; + + if (!argp) + return -EINVAL; + for (i = 0; i < 16; i++) + NodeName[i] = readb(&h->cfgtable->ServerName[i]); + if (copy_to_user(argp, NodeName, sizeof(NodeName_type))) + return -EFAULT; + return 0; +} + static int cciss_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { @@ -1309,19 +1323,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode, case CCISS_SETINTINFO: return cciss_setintinfo(h, argp); case CCISS_GETNODENAME: - { - NodeName_type NodeName; - int i; - - if (!arg) - return -EINVAL; - for (i = 0; i < 16; i++) - NodeName[i] = - readb(&h->cfgtable->ServerName[i]); - if (copy_to_user(argp, NodeName, sizeof(NodeName_type))) - return -EFAULT; - return 0; - } + return cciss_getnodename(h, argp); case CCISS_SETNODENAME: { NodeName_type NodeName; |