tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How PUFFS should deal with EDQUOT?



On Mon, Sep 22, 2014 at 06:18:31AM +0000, Antti Kantee wrote:
> I'd guess the key to success would be to support genfs_ops in puffs so that
> the file server is consulted about block allocations.

It seems I just have to call GOP_ALLOC in puffs_vnop_write()
(see below) and implement puffs_vnop_fallocate(). Since having 
VOP_FALLOCATE() in FFS looks difficult in the near future, 
libperfuse turns it into big writes to the file, which fail on 
EDQUOT or NOSPC. That way failure is produced before data enter
the page cache, which is what we were looking for.

Opinion?

--- puffs_vnops.c.orig  2014-09-27 06:30:02.000000000 +0200
+++ puffs_vnops.c       2014-09-27 06:30:13.000000000 +0200
@@ -2342,8 +2342,14 @@
                 */
                if (ap->a_ioflag & IO_APPEND)
                        uio->uio_offset = vp->v_size;
 
+               origoff = uio->uio_offset;
+               error = GOP_ALLOC(vp, origoff, uio->uio_resid,
+                                 0, curlwp->l_cred);
+               if (error)
+                       goto out;
+
                while (uio->uio_resid > 0) {
                        oldoff = uio->uio_offset;
                        bytelen = uio->uio_resid;
 



-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index