tech-kern archive

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

Re: struct file at VFS level (round 1.5)



> On 03 May 2016, at 14:20, Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
> 
> On Tue, May 03, 2016 at 12:05:01PM +0200, Christoph Badura wrote:
>> Didn't I just explain to you that a struct file is never an owner for
>> these locks?  Didn't others explain that to you too?
> 
> Well, I need you to explain me what happens in sys_flock() then.
> Is it a bug?
>                error = VOP_ADVLOCK(vp, fp, F_UNLCK, &lf, F_FLOCK);
> 
> fp is struct file. Same thing happens in open_setfp() and closef()

The second argument is an identifier, "struct proc *" if the flags
(the last argument) contain "F_POSIX" and "struct file *" otherwise.

Fcntl(2) uses F_POSIX where flock(2) does not.

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)



Home | Main Index | Thread Index | Old Index