Re: f_owner.lock and file->pos updates

2007-03-07 Thread Michael K. Edwards
I wrote: I didn't see any clean way to intersperse overwrites and appends to a record-structured file without using vfs_llseek, which steps on f_pos. The context, of course, is an attempt to fix -ENOPATCH with regard to the netlink-based AIO submission scheme I outlined a couple of days ago.

Re: f_owner.lock and file->pos updates

2007-03-07 Thread Michael K. Edwards
On 3/7/07, Alan Cox <[EMAIL PROTECTED]> wrote: The right way IMHO would be to do the work that was done for pread/pwrite and implement preadv/pwritev. The moment you want to do atomic things with the file->f_pos instead of doing it with a local passed pos value it gets ugly.. why do you need to

Re: f_owner.lock and file->pos updates

2007-03-07 Thread Alan Cox
On Wed, 7 Mar 2007 11:17:36 -0800 "Michael K. Edwards" <[EMAIL PROTECTED]> wrote: > Suppose I want to create an atomic llseek+writev operation. Is this > more or less sufficient: The right way IMHO would be to do the work that was done for pread/pwrite and implement preadv/pwritev. The moment

f_owner.lock and file->pos updates

2007-03-07 Thread Michael K. Edwards
Suppose I want to create an atomic llseek+writev operation. Is this more or less sufficient: ssize_t ret = -EBADF; file = fget_light(fd, _needed); if (file) { if (unlikely(origin > 2)) { ret = -EINVAL; } else {

f_owner.lock and file-pos updates

2007-03-07 Thread Michael K. Edwards
Suppose I want to create an atomic llseek+writev operation. Is this more or less sufficient: ssize_t ret = -EBADF; file = fget_light(fd, fput_needed); if (file) { if (unlikely(origin 2)) { ret = -EINVAL; } else {

Re: f_owner.lock and file-pos updates

2007-03-07 Thread Alan Cox
On Wed, 7 Mar 2007 11:17:36 -0800 Michael K. Edwards [EMAIL PROTECTED] wrote: Suppose I want to create an atomic llseek+writev operation. Is this more or less sufficient: The right way IMHO would be to do the work that was done for pread/pwrite and implement preadv/pwritev. The moment you

Re: f_owner.lock and file-pos updates

2007-03-07 Thread Michael K. Edwards
On 3/7/07, Alan Cox [EMAIL PROTECTED] wrote: The right way IMHO would be to do the work that was done for pread/pwrite and implement preadv/pwritev. The moment you want to do atomic things with the file-f_pos instead of doing it with a local passed pos value it gets ugly.. why do you need to do

Re: f_owner.lock and file-pos updates

2007-03-07 Thread Michael K. Edwards
I wrote: I didn't see any clean way to intersperse overwrites and appends to a record-structured file without using vfs_llseek, which steps on f_pos. The context, of course, is an attempt to fix -ENOPATCH with regard to the netlink-based AIO submission scheme I outlined a couple of days ago.