[Ocfs2-devel] [PATCH 2/2] Ocfs2: Add new OCFS2_INFO_IOC ioctls for ocfs2 v4.
Joel Becker
Joel.Becker at oracle.com
Thu Dec 31 12:13:13 PST 2009
On Thu, Dec 31, 2009 at 04:18:44PM +0800, Tristan Ye wrote:
> +int ocfs2_info_handle_unknown(struct inode *inode,
> + struct ocfs2_info_request __user *user_req)
> +{
> + int status = 0;
> + struct ocfs2_info_request req;
> +
> + if (copy_from_user(&req, user_req, sizeof(struct ocfs2_info_request))) {
> + status = -EFAULT;
> + goto bail;
> + }
> +
> + req.ir_flags &= ~OCFS2_INFO_FL_FILLED;
> +
> + if (copy_to_user((struct ocfs2_info_request __user *)user_req, &req,
> + sizeof(struct ocfs2_info_request))) {
Don't need the cast of user_req here. It's already of the
correct type.
Joel
--
"When ideas fail, words come in very handy."
- Goethe
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-devel
mailing list