<div dir="ltr">It would be nice to make the fop match the writesame() semantics (@buf, @len, @offset, @repeat) and just use it for zerofill as a specific use case, by providing a 1 byte buffer storing a 0, repeated @len times. Thoughts?<div class="gmail_extra">
<br></div><div class="gmail_extra" style>In the storage/bd layer, you can detect if the arguments are trying to zero-fill (by inspecting @buf) and conditionally call ioctl(BLKZEROOUT). This will prepare gluster for providing a more generic block layer interface (in the furtue, for iSCSI?)</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra">Avati<br><br><div class="gmail_quote">On Sun, Jun 9, 2013 at 8:53 PM, Bharata B Rao <span dir="ltr">&lt;<a href="mailto:bharata.rao@gmail.com" target="_blank">bharata.rao@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We are planning to add a new FOP to GlusterFS to exploit the WRITE<br>
SAME capability of the underlying block device in case of BD xlator.<br>
Linux has recently added support for WRITE SAME by means of a new<br>
ioctl (BLKZEROOUT) that can be used to zero-out a range of blocks. We<br>
are proposing the following FOP to support BLKZEROOUT ioctl in<br>
GlusterFS:<br>
<br>
int zerofill(struct glfs_fd *glfd, off_t offset, size_t len)<br>
<br>
This will zero-out the range of the file represented by @glfd,<br>
starting from @offset for @len bytes.<br>
<br>
Posix backend can implement the zerofill() in whatever way that is<br>
convenient/efficient, all it has do is to write zeroes to the file in<br>
the specified range.<br>
<br>
BD backend will issue ioctl(fd, BLKZEROOUT, params[2]) in response to<br>
zerofill(glfd, offset, len). param[0] is the starting sector number<br>
which should be derived from offset. param[1] is the nr_sectors which<br>
should be derived from len.<br>
<br>
Regards,<br>
Bharata.<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="http://raobharata.wordpress.com/" target="_blank">http://raobharata.wordpress.com/</a><br>
<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
</font></span></blockquote></div><br></div></div>