Re: Anonymous vnodes?

2023-06-28 Thread Taylor R Campbell
On discussion with chs@, I realize that: (a) you could just use uao_create(INT64_MAX - PAGE_SIZE), like tmpfs does, and not bother with defining a uao_resize (just .pgo_put the pages when you truncate and update the length under the lock); but (b) this is kind of duplicating the existing

Re: Anonymous vnodes?

2023-06-27 Thread Taylor R Campbell
> Date: Tue, 27 Jun 2023 16:27:34 -0400 > From: Theodore Preduta > > On 2023-06-26 20:03, Taylor R Campbell wrote: > > For a syscall, you should implement it in terms of uvm anonymous > > objects: > > Is there a preexisting way to resize a uvm_object? Or do I need to > write a function similar

Re: Anonymous vnodes?

2023-06-27 Thread Theodore Preduta
On 2023-06-26 20:03, Taylor R Campbell wrote: >> Date: Mon, 26 Jun 2023 18:13:17 -0400 >> From: Theodore Preduta >> >> Is it possible to create a vnode for a regular file in a file system >> without linking the vnode to any directory, so that it disappears when >> all open file descriptors to it

Re: Anonymous vnodes?

2023-06-27 Thread Joerg Sonnenberger
On Mon, Jun 26, 2023 at 06:13:17PM -0400, Theodore Preduta wrote: > Is it possible to create a vnode for a regular file in a file system > without linking the vnode to any directory, so that it disappears when > all open file descriptors to it are closed? (As far as I can tell, this > isn't

Re: Anonymous vnodes?

2023-06-27 Thread Christoph Badura
On Tue, Jun 27, 2023 at 11:30:24AM -0400, Mouse wrote: > It's a normal state to be in. But, as I read it, the post was asking > for a way to reach that state _without_ passing through a "has a name > in some directory" state; it's not clear to me whether that's possible > in general (ie, without

Re: Anonymous vnodes?

2023-06-27 Thread Martin Husemann
On Tue, Jun 27, 2023 at 05:20:50PM +0200, Reinoud Zandijk wrote: > That's completely normal. If a file is created in a file system and its > unlinked its effectively in this state. While that is true, a vnode is an internal representation of some entity in some file system. What you really want

Re: Anonymous vnodes?

2023-06-27 Thread Mouse
>> Is it possible to create a vnode for a regular file in a file system >> without linking the vnode to any directory, so that it disappears >> when all open file descriptors to it are closed? (As far as I can >> tell, this isn't possible with any of the vn_* or VOP_* functions?) > That's

Re: Anonymous vnodes?

2023-06-27 Thread Reinoud Zandijk
Hi, On Mon, Jun 26, 2023 at 06:13:17PM -0400, Theodore Preduta wrote: > Is it possible to create a vnode for a regular file in a file system without > linking the vnode to any directory, so that it disappears when all open file > descriptors to it are closed? (As far as I can tell, this isn't

Re: Anonymous vnodes?

2023-06-26 Thread Taylor R Campbell
> Date: Mon, 26 Jun 2023 18:13:17 -0400 > From: Theodore Preduta > > Is it possible to create a vnode for a regular file in a file system > without linking the vnode to any directory, so that it disappears when > all open file descriptors to it are closed? (As far as I can tell, this > isn't

Re: Anonymous vnodes?

2023-06-26 Thread RVP
On Mon, 26 Jun 2023, Theodore Preduta wrote: Is it possible to create a vnode for a regular file in a file system without linking the vnode to any directory, so that it disappears when all open file descriptors to it are closed? (As far as I can tell, this isn't possible with any of the vn_*

Re: Anonymous vnodes?

2023-06-26 Thread Jason Thorpe
> On Jun 26, 2023, at 3:13 PM, Theodore Preduta wrote: > > Is it possible to create a vnode for a regular file in a file system > without linking the vnode to any directory, so that it disappears when > all open file descriptors to it are closed? (As far as I can tell, this > isn't possible

Anonymous vnodes?

2023-06-26 Thread Theodore Preduta
Is it possible to create a vnode for a regular file in a file system without linking the vnode to any directory, so that it disappears when all open file descriptors to it are closed? (As far as I can tell, this isn't possible with any of the vn_* or VOP_* functions?) If this idea is indeed not