RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-20 Thread KY Srinivasan
] Sent: Thursday, January 16, 2014 2:49 AM To: KY Srinivasan Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; a...@canonical.com; jasow...@redhat.com Subject: Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service On Tue, Jan 14, K. Y

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-20 Thread Olaf Hering
On Mon, Jan 20, KY Srinivasan wrote: I am cleaning up the code based on your feedback. By the time I am done with my cleanup, I doubt if this patch would apply. Do you mind if I were to include your changes here as part of my cleanup? Yes, thats fine. Olaf

RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-20 Thread KY Srinivasan
] Drivers: hv: Implement the file copy service On Mon, Jan 20, KY Srinivasan wrote: I am cleaning up the code based on your feedback. By the time I am done with my cleanup, I doubt if this patch would apply. Do you mind if I were to include your changes here as part of my cleanup? Yes

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread Olaf Hering
On Tue, Jan 14, K. Y. Srinivasan wrote: +enum hv_fcopy_op { + START_FILE_COPY = 0, + WRITE_TO_FILE, + COMPLETE_FCOPY, + CANCEL_FCOPY, +}; + +struct hv_fcopy_hdr { + enum hv_fcopy_op operation; + uuid_le service_id0; /* currently unused */ + uuid_le

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread Olaf Hering
On Tue, Jan 14, K. Y. Srinivasan wrote: Implement the file copy service for Linux guests on Hyper-V. This permits the host to copy a file (over VMBUS) into the guest. This facility is part of guest integration services supported on the Windows platform. Here is a link that provides additional

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread Olaf Hering
On Tue, Jan 14, K. Y. Srinivasan wrote: This function should return valid numbers: +static ssize_t fcopy_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + int error = 0; + + if (count != sizeof(int)) + return 0;

RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread KY Srinivasan
] Drivers: hv: Implement the file copy service On Tue, Jan 14, K. Y. Srinivasan wrote: +enum hv_fcopy_op { + START_FILE_COPY = 0, + WRITE_TO_FILE, + COMPLETE_FCOPY, + CANCEL_FCOPY, +}; + +struct hv_fcopy_hdr { + enum hv_fcopy_op operation; + uuid_le service_id0

RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread KY Srinivasan
] Drivers: hv: Implement the file copy service On Tue, Jan 14, K. Y. Srinivasan wrote: Implement the file copy service for Linux guests on Hyper-V. This permits the host to copy a file (over VMBUS) into the guest. This facility is part of guest integration services supported

RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread KY Srinivasan
] Drivers: hv: Implement the file copy service On Tue, Jan 14, K. Y. Srinivasan wrote: This function should return valid numbers: +static ssize_t fcopy_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + int error = 0

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-16 Thread Dan Carpenter
On Thu, Jan 16, 2014 at 10:42:01AM +0100, Olaf Hering wrote: On Tue, Jan 14, K. Y. Srinivasan wrote: +enum hv_fcopy_op { + START_FILE_COPY = 0, + WRITE_TO_FILE, + COMPLETE_FCOPY, + CANCEL_FCOPY, +}; + +struct hv_fcopy_hdr { + enum hv_fcopy_op operation; + uuid_le

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-15 Thread Olaf Hering
On Tue, Jan 14, K. Y. Srinivasan wrote: +static int hv_start_fcopy(struct hv_start_fcopy *smsg) + if (access((char *)smsg-path_name, F_OK)) { + if (smsg-copy_flags CREATE_PATH) { + if (mkdir((char *)smsg-path_name, 0755)) { KY, I guess this needs a loop

RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-15 Thread KY Srinivasan
] Drivers: hv: Implement the file copy service On Tue, Jan 14, K. Y. Srinivasan wrote: +static int hv_start_fcopy(struct hv_start_fcopy *smsg) + if (access((char *)smsg-path_name, F_OK)) { + if (smsg-copy_flags CREATE_PATH) { + if (mkdir((char *)smsg

Re: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-14 Thread Olaf Hering
On Tue, Jan 14, K. Y. Srinivasan wrote: +static ssize_t fcopy_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + int error = 0; + + if (count != sizeof(int)) + return 0; + + if (copy_from_user(error, buf,

RE: [PATCH V2 1/1] Drivers: hv: Implement the file copy service

2014-01-14 Thread KY Srinivasan
] Drivers: hv: Implement the file copy service On Tue, Jan 14, K. Y. Srinivasan wrote: +static ssize_t fcopy_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + int error = 0; + + if (count != sizeof(int)) + return 0