Subject: Re: f_iflags/FIF_* of struct file (Was: Re: CVS commit: syssrc/sys)
To: None <>
From: Jaromir Dolecek <>
List: tech-kern
Date: 12/12/2001 00:23:52
I'd like to discuss change to struct file (internal kernel thing).
I've made following change last week, which was backed off
later upon Jason's request:

>  > Modified Files:
>  > 	syssrc/sys/kern: kern_descrip.c
>  > 	syssrc/sys/sys: fcntl.h file.h
>  > 
>  > Log Message:
>  > replace FIF_WANTCLOSE/FIF_LARVAL with FWANTCLOSE/FLARVAL, which are set
>  > in f_flag of struct file
>  > for now, keep former f_iflags of struct file as _f_spare0, it will be g/c'ed
>  > when struct file will be changed (this will happen soon)

Jason R Thorpe wrote:
> FIF_* are *INTERNAL* flags, not to be in the same namespace as the
> other F* flags.  And, in a fine-grained locking world, they might be
> protected by different locks.

I understand that LARVAL flag is not in same namespace as e.g. O_APPEND
or FASYNC. That's why we have O_MASK and FMASK.

There are already some F* flags which are really internal and
only used on special places - FMARK, FDEFER, FHASLOCK.

I do not see a need to have separate f_iflags, when f_flag is
sufficient. It unnecessarily wastes 4 bytes per file descriptor.
Though the fine-grained locking world is potential issue here, I
seriously doubt that there would be _ever_ more than one lock per
descriptor. Until we'd be really solving some real locking problem
here, I'd prefer to have single 'flags' member.

Opinions? I'd like to proceed with the change eventually (like
within a week or so), i.e.  commit it again and leave in tree.

Jaromir Dolecek <>
-=  Those who would give up liberty for a little temporary safety deserve  =-
-=  neither liberty nor safety, and will lose both.  -- Benjamin Franklin  =-