Skip to content

Commit

Permalink
statx: commenting out unsupported struct members and define.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoSTEALTH committed Mar 6, 2024
1 parent c6ff9e0 commit 22ed90b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
8 changes: 5 additions & 3 deletions src/liburing/lib/statx.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ cdef extern from '<linux/stat.h>' nogil:
__u32 stx_dev_minor
# 0x90
__u64 stx_mnt_id
__u32 stx_dio_mem_align # Memory buffer alignment for direct I/O
__u32 stx_dio_offset_align # File offset alignment for direct I/O
# note: not supported
# __u32 stx_dio_mem_align # Memory buffer alignment for direct I/O
# __u32 stx_dio_offset_align # File offset alignment for direct I/O

# Mask - flags to be set for `stx_mask`
# - Query request/result mask for `statx()` and struct `statx::stx_mask`.
Expand All @@ -57,7 +58,8 @@ cdef extern from '<linux/stat.h>' nogil:
__STATX_BASIC_STATS 'STATX_BASIC_STATS' # [All of the above]
__STATX_BTIME 'STATX_BTIME' # Want|got `stx_btime`
__STATX_MNT_ID 'STATX_MNT_ID' # Got `stx_mnt_id`
__STATX_DIOALIGN 'STATX_DIOALIGN' # Want/got direct I/O alignment info
# note: not supported
# __STATX_DIOALIGN 'STATX_DIOALIGN' # Want/got direct I/O alignment info

# Attributes to be found in `stx_attributes` and masked in `stx_attributes_mask`.
enum:
Expand Down
19 changes: 11 additions & 8 deletions src/liburing/statx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ cdef class statx:
def stx_mnt_id(self):
return self.ptr.stx_mnt_id

@property
def stx_dio_mem_align(self):
return self.ptr.stx_dio_mem_align
# note: not supported
# @property
# def stx_dio_mem_align(self):
# return self.ptr.stx_dio_mem_align

@property
def stx_dio_offset_align(self):
return self.ptr.stx_dio_offset_align
# @property
# def stx_dio_offset_align(self):
# return self.ptr.stx_dio_offset_align

# Inode
# -----
Expand Down Expand Up @@ -222,7 +223,8 @@ cpdef inline void io_uring_prep_statx(io_uring_sqe sqe,
STATX_BASIC_STATS # [All of the above]
STATX_BTIME # Want|got `stx_btime`
STATX_MNT_ID # Got `stx_mnt_id`
STATX_DIOALIGN # Want/got direct I/O alignment info
# note: not supported
# STATX_DIOALIGN # Want/got direct I/O alignment info

Note
- Keep reference to `path` or else it will raise `FileNotFoundError`
Expand All @@ -249,7 +251,8 @@ STATX_BLOCKS = __STATX_BLOCKS
STATX_BASIC_STATS = __STATX_BASIC_STATS
STATX_BTIME = __STATX_BTIME
STATX_MNT_ID = __STATX_MNT_ID
STATX_DIOALIGN = __STATX_DIOALIGN
# note: not supported
# STATX_DIOALIGN = __STATX_DIOALIGN

STATX_ATTR_COMPRESSED = __STATX_ATTR_COMPRESSED
STATX_ATTR_IMMUTABLE = __STATX_ATTR_IMMUTABLE
Expand Down
3 changes: 2 additions & 1 deletion test/statx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def test_statx_define():
assert liburing.STATX_BASIC_STATS == 0x000007ff
assert liburing.STATX_BTIME == 0x00000800
assert liburing.STATX_MNT_ID == 0x00001000
assert liburing.STATX_DIOALIGN == 0x00002000
# note: not supported
# assert liburing.STATX_DIOALIGN == 0x00002000

assert liburing.STATX_ATTR_COMPRESSED == 0x00000004
assert liburing.STATX_ATTR_IMMUTABLE == 0x00000010
Expand Down

0 comments on commit 22ed90b

Please sign in to comment.