Page MenuHomeFreeBSD

linux: implement statx(2)
ClosedPublic

Authored by trasz on May 26 2021, 12:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 12:51 PM
Unknown Object (File)
Tue, Nov 5, 9:47 AM
Unknown Object (File)
Sun, Nov 3, 9:22 PM
Unknown Object (File)
Fri, Oct 18, 8:56 AM
Unknown Object (File)
Wed, Oct 16, 9:11 PM
Unknown Object (File)
Tue, Oct 15, 6:18 AM
Unknown Object (File)
Oct 14 2024, 6:59 AM
Unknown Object (File)
Oct 12 2024, 1:22 AM

Details

Summary

PR: 252106
Submitted By: pitwuu at gmail.com

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 39536
Build 36425: arc lint + arc unit

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.