On Wed, Nov 20, 2024 at 12:10 PM Christian Brauner <brauner@xxxxxxxxxx> wrote: > > > But if anybody is really worried about running out of f_mode bits, we > > could almost certainly turn the existing > > > > unsigned int f_flags; > > > > into a bitfield, and make it be something like > > > > unsigned int f_flags:26, f_special:6; > > I just saw this now. Two points I would like to keep you to keep mind. > > I've already mentiond that I've freed up 5 fmode bits so it's not that > we're in immediate danger of running out. Especially since I added > f_ops_flags which contains all flags that are static, i.e., never change > and can simply live in the file operations struct and aren't that > performance sensitive. > > I shrunk struct file to three cachelines. And in fact, we have 8 bytes > to use left since I removed f_version. So it really wouldn't be a > problem to simply add a separate u32 f_special member into struct file > without growing it and still leaving a 4 byte hole if it ever comes to > that. That's good to know, but for the record, I ended up using just one extra f_mode bit for fsnotify [1]. Thanks, Amir. [1] https://lore.kernel.org/linux-fsdevel/5ea5f8e283d1edb55aa79c35187bfe344056af14.1731684329.git.josef@xxxxxxxxxxxxxx/