On Fri, Apr 26, 2024 at 09:58:54AM +0200, Dawid Osuchowski wrote: > Creates an anon_inode_getfile_fmode() function that works similarly to > anon_inode_getfile() with the addition of being able to set the fmode > member. One note (followup commit fodder, probably in series with conversions to that interface): > + * @f_mode: [in] fmode > + * setup. Allows setting the fmode. Returns the newly created file* or an error is ambiguous - with no further information it reads as if we passed the value to store in ->f_mode, which is not what's going on. Something along the lines of 'f_mode' argument allows to set additional bits, on top of the ones set by anon_inode_getfile() (FMODE_{OPENED,READ,WRITE,LSEEK,CAN_READ,CAN_WRITE}). The caller should not pass those in 'f_mode' - they will be set according to 'flags' and 'fops' in all cases.