On 3/27/24 10:45 AM, Christian Brauner wrote: > There's a bunch of flags that are purely based on what the file > operations support while also never being conditionally set or unset. > IOW, they're not subject to change for individual file opens. Imho, such > flags don't need to live in f_mode they might as well live in the fops > structs itself. And the fops struct already has that lonely > mmap_supported_flags member. We might as well turn that into a generic > fops_flags member and move a few flags from FMODE_* space into FOP_* > space. That gets us four FMODE_* bits back and the ability for new > static flags that are about file ops to not have to live in FMODE_* > space but in their own FOP_* space. It's not the most beautiful thing > ever but it gets the job done. Yes, there'll be an additional pointer > chase but hopefully that won't matter for these flags. Not doing that extra dereference is kind of the point of the FMODE_* flags, at least the ones that I care about. Probably not a huge deal for these cases though, as we're generally going to call one of the f_op handlers shortly anyway. The cases where we don't, at least for io_uring, we already cache the state separately. Hence more of a general observation than an objection to the patch. I do like freeing up FMODE space, as it's (pretty) full. -- Jens Axboe