lkml.org 
[lkml]   [2006]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Support HDIO_GETGEO on device-mapper volumes
"Darrick J. Wong" <djwong@us.ibm.com> wrote:
>
> The attached patch implements a simple ioctl handler that supplies a
> compatible geometry when HDIO_GETGEO is called against a device-mapper
> device.

block_device_operations now has a standalone `getgeo' method.

> ...
> +static int dm_blk_ioctl(struct inode * inode, struct file * filp,
> + unsigned int cmd, unsigned long arg)
> +{
> + struct block_device *bdev = inode->i_bdev;
> + struct hd_geometry __user *loc = (void __user *)arg;
> + struct mapped_device *md;
> + int diskinfo[4];
> +
> + if (cmd == HDIO_GETGEO) {
> + if (!arg)
> + return -EINVAL;

I don't think we need that check? The -EFAULT should suffice.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-10 04:02    [W:0.866 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site