[SMB3] [PATCH] statx enablement for cifs.ko
Steve French
smfrench at gmail.com
Fri Sep 22 06:47:17 UTC 2017
I don't want to always add the bits - but always add the line which
says that they are supported flags. Compare to btrfs's inode.c
The mask is always set to say that we support returning those flags
(whether encrypted/compressed is set - we return that the flag is a
valid flag via the mask)
9660 stat->result_mask |= STATX_BTIME;
9661 stat->btime.tv_sec = BTRFS_I(inode)->i_otime.tv_sec;
9662 stat->btime.tv_nsec = BTRFS_I(inode)->i_otime.tv_nsec;
9663 if (bi_flags & BTRFS_INODE_APPEND)
9664 stat->attributes |= STATX_ATTR_APPEND;
9665 if (bi_flags & BTRFS_INODE_COMPRESS)
9666 stat->attributes |= STATX_ATTR_COMPRESSED;
9667 if (bi_flags & BTRFS_INODE_IMMUTABLE)
9668 stat->attributes |= STATX_ATTR_IMMUTABLE;
9669 if (bi_flags & BTRFS_INODE_NODUMP)
9670 stat->attributes |= STATX_ATTR_NODUMP;
9671
9672 stat->attributes_mask |= (STATX_ATTR_APPEND |
9673 STATX_ATTR_COMPRESSED |
9674 STATX_ATTR_IMMUTABLE |
9675 STATX_ATTR_NODUMP);
On Fri, Sep 22, 2017 at 1:41 AM, Stefan Metzmacher <metze at samba.org> wrote:
> Am 22.09.2017 um 08:27 schrieb Steve French:
>> What do you mean?
>>
>> On Fri, Sep 22, 2017 at 1:20 AM, Stefan Metzmacher via samba-technical <
>> samba-technical at lists.samba.org> wrote:
>>
>>> Hi Steve,
>>>
>>>> + stat->attributes_mask |= (STATX_ATTR_COMPRESSED |
>>> STATX_ATTR_ENCRYPTED);
>>>> + if (CIFS_I(inode)->cifsAttrs & FILE_ATTRIBUTE_COMPRESSED)
>>>> + stat->attributes |= STATX_ATTR_COMPRESSED;
>>>> + if (CIFS_I(inode)->cifsAttrs & FILE_ATTRIBUTE_ENCRYPTED)
>>>> + stat->attributes |= STATX_ATTR_ENCRYPTED;
>>>
>>> I guess the first line was only for testing?
>
> Do you *always* want to add the COMPRESSED and ENCRYPTED bits?
> If you *really* want that, why the if statements?
>
> metze
>
>
--
Thanks,
Steve
More information about the samba-technical
mailing list