Deduplicating code in BsdUserDefinedFileAttributeView and LinuxUserDefinedFileAttributeView
Sebastian Stenzel
sebastian.stenzel at gmail.com
Tue Feb 2 11:25:49 UTC 2021
> On 2. Feb 2021, at 12:15, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> On 02/02/2021 10:02, Sebastian Stenzel wrote:
>> :
>>
>> Bonus question: May I change `capabilities` to long? https://github.com/openjdk/jdk/blob/jdk-17+7/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java#L569-L574 <https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/jdk-17*7/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java*L569-L574__;KyM!!GqivPVa7Brio!PaPuewCCxFb9a7f0XBQZdRHRwsjD81df1TlabuvZ3yIwhxYiB9XK8a-QZAYUGB_l2g$>
>> I'd like to add `SUPPORTS_XATTR`, but I guess `1 << 32` won't fit into an int.
> It might be better to just fix the initialization of the existing SUPPORTS_ constants. There are only 5 of them so there are lots of bits available.
>
> -Alan.
Right. Should I keep SUPPORTS_BIRTHTIME as 2^16? The comments suggest there are two different domains of supported features.
Proposal:
```
private static final int SUPPORTS_OPENAT = 1 << 1; // syscalls
private static final int SUPPORTS_FUTIMES = 1 << 2;
private static final int SUPPORTS_FUTIMENS = 1 << 3;
private static final int SUPPORTS_LUTIMES = 1 << 4;
private static final int SUPPORTS_XATTR = 1 << 5;
private static final int SUPPORTS_BIRTHTIME = 1 << 16; // other features
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210202/633be202/attachment.htm>
More information about the nio-dev
mailing list