[systemd-devel] [PATCH 2/2] tmpfiles: support globbing for w option
Lennart Poettering
lennart at poettering.net
Tue Sep 11 05:41:51 PDT 2012
On Mon, 10.09.12 22:42, Dave Reisner (d at falconindy.com) wrote:
> > > Just to add to this, is there a particular reason writev was chosen?
> >
> > One atomic syscall to write this string without copying any data, that's
> > the advantage of the scatter/gather interfaces. Not that it would matter
> > much in this case, but I guess it generally is a good habit using
> > writev() where appropriate...
> >
>
> One atomic syscall sure -- and that't the point of writev. However, the
> backend implementation is still of our concern. It obviously doesn't do
> what we want. You actually want that the kernel changes its heuristics
> on specific filesystems so that it modifies the behavior that userspace
> explicitly requests? Sorry, but this seems entirely wrong to me.
I don't follow. I am pretty sure the following two code snippets should
have the very same effect on any fs:
const char blob[] = "abcdef";
write(fd, blob, 6);
and:
const char blob[] = "abcdef";
struct iovec iov[2];
iov[0].iov_base = blob;
iov[0].iov_len = 3;
iov[1].iov_base = blob + 3;
iov[1].iov_len = 3;
writev(fd, iov, 2);
And they do have the same effect on most fs, except on sysfs. Now I am
wondering whether this is somthing to fix in the kernel, or to just accept.
Kay, Michal, you are kernel guys, what do you think about this?
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list