On Sun, Aug 16, 2009 at 03:39:29PM -0400, Christoph Hellwig wrote: > On Sun, Aug 16, 2009 at 08:25:36PM +1000, npiggin@xxxxxxx wrote: > > } > > > > +int simple_setsize(struct inode *inode, loff_t newsize) > > +{ > > This wants a kerneldoc comment. Which should also mention that we can't > easily use this helper if we actuall do need to truncate blocks on disk. Yep, good idea. > > =================================================================== > > --- linux-2.6.orig/fs/buffer.c > > +++ linux-2.6/fs/buffer.c > > @@ -1992,9 +1992,14 @@ int block_write_begin(struct file *file, > > * prepare_write() may have instantiated a few blocks > > * outside i_size. Trim these off again. Don't need > > * i_size_read because we hold i_mutex. > > + * > > + * Filesystems which set i_op->new_truncate must > > + * handle this themselves. Eventually this will go > > + * away because everyone will be converted. > > */ > > if (pos + len > inode->i_size) > > - vmtruncate(inode, inode->i_size); > > + if (!inode->i_op->new_truncate) > > + vmtruncate(inode, inode->i_size); > > Btw, what is you guestimate on how fast we'll get the conversion done? > > We have 19 instances of ->truncate currently. Your patch currently > takes care of two, and I have an XFS patch leaving another 16. I guess you can do really dumb ones using simple_setsize and then call their old ->truncate method, basically just moving the vmtruncate compat code into the filesystems. Then you just need to do a bit of work to trim blocks after a failed write(2). I think I will try going through and doing a round of those, and then send them off to fs maintainers to do anything fancier. Might take a day or so, which I should be able to get time to do. > Can the maintainers on this list look into their filesystems to move > forward? Yes this would be nice. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html