Re: [ANNOUNCEMENT PATCH COW] proof of concept impementation of cowlinks

From: Rob Landley
Date: Tue May 25 2004 - 16:31:04 EST


On Tuesday 11 May 2004 09:08, Jan Harkes wrote:

> int my_file_sendfile(struct file *in_file, loff_t *ppos, size_t count,
> read_actor_t actor, void __user *target)
> {
> struct file *out_file = NULL;
>
> /* We have to check the read_actor callback function to see if the
> * target actually points at a struct file. */
> if (actor != file_send_actor)
> goto copy_local;
>
> /* are both source and destination within the same file system
> * mountpoint? */
> if (in_file->f_dentry->d_inode->i_sb !=
> out_file->f_dentry->d_inode->i_sb) goto copy_local;
>
> /* are we copying the entire source file? */
> if (*ppos != 0 || count != in_file->f_dentry->d_inode->i_size)
> goto copy_local;

Is there a race condition for i_size to change between the api getting called
and the copy being done? More to the point, is there some way to specify a
count of -1 or something to easily say "to end of file"?

Rob
--
www.linucon.org: Linux Expo and Science Fiction Convention
October 8-10, 2004 in Austin Texas. (I'm the con chair.)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/