Re: fallocate for FFS

2022-09-26 Thread Mouse
>>> I will try to figure it out, since its not yet implemented the
>>> syscall is a good way to start dev in BSD kernel.
>> I'm not sure about that; many people have started looking at it and
>> not got anywhere.
> It is true that adding a system call is an easy entry point to learn
> about the kernel.  But here the syscall is the easy part, the real
> work is modifying FFS code to suport it, and that is a steep learning
> curve.

Not just a steep learning curve.  Some of the fallocate operations
(mode zero in particular) would be fairly easy.  But, as someone who
knows somewhat of FFS, I would say some of the operations, in
particular anything that involves allocating space after EOF, would be
rather difficult to implement even for someone who's past the learning
curve.  (Some others, while easy, would be tedious and expensive;
FALLOC_FL_COLLAPSE_RANGE is an example.  While it would technically be
possible to make it fast and simple by taking advantage of the
granularity requirement leeway, such an implementation would be too
restrictive to be worth doing.)

/~\ The ASCII Mouse
\ / Ribbon Campaign
 X  Against HTMLmo...@rodents-montreal.org
/ \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Re: fallocate for FFS

2022-09-26 Thread Emmanuel Dreyfus
On Mon, Sep 26, 2022 at 11:24:15PM +, David Holland wrote:
>  > I will try to figure it out, since its not yet implemented the syscall is a
>  > good way to start dev in BSD kernel.
> 
> I'm not sure about that; many people have started looking at it and
> not got anywhere.

It is true that adding a system call is an easy entry point to learn about 
the kernel. But here the syscall is the easy part, the real work is modifying
FFS code to suport it, and that is a steep learning curve.

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: fallocate for FFS

2022-09-26 Thread David Holland
On Mon, Sep 26, 2022 at 06:15:23PM +0200, Patryk wrote:
 > I will try to figure it out, since its not yet implemented the syscall is a
 > good way to start dev in BSD kernel.

I'm not sure about that; many people have started looking at it and
not got anywhere.

-- 
David A. Holland
dholl...@netbsd.org


Re: fallocate for FFS

2022-09-26 Thread Patryk
Hi,
I will try to figure it out, since its not yet implemented the syscall is a
good way to start dev in BSD kernel.

Pozdrawiam,
Patryk Ząbkiewicz



niedz., 25 wrz 2022 o 21:15 Reinoud Zandijk  napisał(a):

> Hi,
>
> On Fri, Sep 23, 2022 at 03:51:26PM +0200, Patryk wrote:
> > is this item already developed in netBSD or should I start looking into
> it ?
> > https://wiki.netbsd.org/projects/project/ffs-fallocate/
>
> AFAIK, its not implemented yet in NetBSD. I guess it got a bit on the back
> burner due to the tendency that programs detecting fallocate() missing
> tend to
> use truncate() for this though it of course doesn't guarantee all is
> allocated.
>
> It shouldn't be that difficult to implement on its own but the more
> difficult
> part is I guess figuring out the addition of the system call, the libc stub
> addition and the test code. As for the code itself, consider the code for
> growing files in sys/fs/msdosfs since it does this by necessity as it
> doesn't
> understand holes. I am sure tech-kern@ will be happy to provide you
> pointers
> for the other bits.
>
> With regards,
> Reinoud
>
>