Page MenuHomeFreeBSD

linux: implement statx(2)
ClosedPublic

Authored by trasz on May 26 2021, 12:11 PM.
Tags
None
Referenced Files
F105582097: D30466.id90513.diff
Tue, Dec 17, 10:35 PM
F105581726: D30466.id90047.diff
Tue, Dec 17, 10:29 PM
F105568331: D30466.diff
Tue, Dec 17, 6:30 PM
Unknown Object (File)
Tue, Dec 10, 5:10 PM
Unknown Object (File)
Thu, Dec 5, 6:34 PM
Unknown Object (File)
Mon, Dec 2, 1:06 AM
Unknown Object (File)
Thu, Nov 21, 6:58 AM
Unknown Object (File)
Wed, Nov 20, 5:11 AM

Details

Summary

PR: 252106
Submitted By: pitwuu at gmail.com

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz edited the summary of this revision. (Show Details)
emaste added inline comments.
sys/compat/linux/linux.h
217

Looks like Linux does not have (dropped?) _DIR, just `STATX_ATTR_AUTOMOUNT`

237

this is stx_attributes_mask

246
uint64_t stx_mnt_id
uint64_t spare
uint64_t spare[12]
sys/compat/linux/linux_stats.c
204

for what it's worth memset(&x, 0, sizeof(x)) is slightly more common in kernel now than bzero(&x, sizeof(x))

(Note to self: fails tinderbox, probably depends on https://reviews.freebsd.org/D30193)

sys/compat/linux/linux.h
217

Thanks! Somehow it didn't occur to me to compare the struct layout.

sys/compat/linux/linux_stats.c
204

for what it's worth memset(&x, 0, sizeof(x)) is slightly more common in kernel now than bzero(&x, sizeof(x))

In this file it's mostly bzero(), though. I think we should leave it as it is, for consistency.

Update the struct layout and defines.

Another attempt to fix build.

dchagin added inline comments.
sys/compat/linux/linux_stats.c
776

small optimisatio: may be mask alredy known flags? to see which is bit is unsupported?

sys/compat/linux/linux_stats.c
776

indeed a minor point, but the message reads as if it implies the printed flags are all unsupported so I think it makes sense to either mask the known flags or make the message something like "statx flags 0x%x includes unsupported flags"

sys/compat/linux/linux_stats.c
776

I like the idea of masking off the recognized flags, leaving just the unrecognized ones. However, I'd prefer to do it in a followup commit, as we have at least a dozen places which do that, and I think it's better to fix them together.

I like the idea of masking off the recognized flags ... in a followup commit

Sounds good to me

sys/compat/linux/linux_stats.c
776

agree, Im asking as glibc-2.32 statx test fails, unsupported flags are: 0x2000 and 0x4000

sys/compat/linux/linux_stats.c
776

For reference, those are AT_STATX_FORCE_SYNC (0x2000) and AT_STATX_DONT_SYNC (0x4000).

AT_STATX_FORCE_SYNC
       Force the attributes to be synchronized with the server.
       This may require that a network filesystem perform a data
       writeback to get the timestamps correct.

AT_STATX_DONT_SYNC
       Don't synchronize anything, but rather just take whatever
       the system has cached if possible.  This may mean that the
       information returned is approximate, but, on a network
       filesystem, it may not involve a round trip to the server
       - even if no lease is held.
This revision is now accepted and ready to land.Jun 2 2021, 3:54 PM
This revision now requires review to proceed.Jun 7 2021, 11:04 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 8 2021, 9:10 AM
Closed by commit rG2362ad457a01: linux: implement statx(2) (authored by pitwuu_gmail.com, committed by trasz). · Explain Why
This revision was automatically updated to reflect the committed changes.