Re: [PATCH v3 5/9] fuse: allocate ff->release_args only if release is needed

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

 




On 2/9/24 10:57, Miklos Szeredi wrote:
> On Thu, 8 Feb 2024 at 18:09, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> 
>> @@ -132,15 +134,16 @@ struct fuse_file *fuse_file_open(struct fuse_mount *fm, u64 nodeid,
>>         struct fuse_conn *fc = fm->fc;
>>         struct fuse_file *ff;
>>         int opcode = isdir ? FUSE_OPENDIR : FUSE_OPEN;
>> +       int noopen = isdir ? fc->no_opendir : fc->no_open;
> 
> bool?
> 
>>
>> -       ff = fuse_file_alloc(fm);
>> +       ff = fuse_file_alloc(fm, !noopen);
>>         if (!ff)
>>                 return ERR_PTR(-ENOMEM);
>>
>>         ff->fh = 0;
>>         /* Default for no-open */
>>         ff->open_flags = FOPEN_KEEP_CACHE | (isdir ? FOPEN_CACHE_DIR : 0);
>> -       if (isdir ? !fc->no_opendir : !fc->no_open) {
>> +       if (!noopen) {
> 
> I think this would be more readable without the double negation, i.e
> if the bool variable was called e.g. "open".

We can change to bool. I had _thought_ to suggest in the internal review
round to use

bool is_open = isdir ? !fc->no_opendir : !fc->no_open;

But then we have double negations in the initialization and for me it
didn't seem to be much better than having them below (though two times
then). I guess no issue if you prefer like that.


Thanks,
Bernd





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux