Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jan 2003 20:35:09 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, arch@FreeBSD.ORG
Subject:   Re: getsysfd() patch #1 (Re: Virtual memory question) 
Message-ID:  <20030123043509.EFB672A7EA@canning.wemm.org>
In-Reply-To: <200301230343.h0N3hfXt044969@khavrinen.lcs.mit.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote:
> <<On Wed, 22 Jan 2003 18:59:55 -0800 (PST), Matthew Dillon <dillon@apollo.bac
    kplane.com> said:
[..]
> >     I would far prefer to implement a 
> >     high-level operations vector on descriptors that covers both mmap() and
> >     ftruncate() (at a high level),
> 
> Great idea, you do that.  I don't see it as a show-stopper; it is easy
> to recognize and undo the hacks later when a better implementation is
> ready.

We already have the infrastructure.  It's called 'struct fileops' and
we've already added things to it, and need to add a couple more to fix
some explicitly enumerated switches on file types.

+++ sys/file.h      23 Jan 2003 04:31:56 -0000
@@ -82,2 +82,3 @@
 typedef        int fo_close_t(struct file *fp, struct thread *td);
+typedef        int fo_setsize_t(struct file *fp, struct thread *td, off_t size);
 
@@ -91,2 +92,3 @@
        fo_close_t      *fo_close;
+       fo_setsize_t    *fo_setsize;
 };

The core of the existing truncate stuff would then become vn_setsize
(or vn_truncate if that suits better).

Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030123043509.EFB672A7EA>