History

Merge tag 'vfs-6.14-rc1.statx.dio' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull vfs direct-io updates from Christian Brauner: "File systems that write out of place usually require different alignment for direct I/O writes than what they can do for reads. Add a separate dio read align field to statx, as many out of place write file systems can easily do reads aligned to the device sector size, but require bigger alignment for writes. This is usually papered over by falling back to buffered I/O for smaller writes and doing read-modify-write cycles, but performance for this sucks, so applications benefit from knowing the actual write alignment" * tag 'vfs-6.14-rc1.statx.dio' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: xfs: report larger dio alignment for COW inodes xfs: report the correct read/write dio alignment for reflinked inodes xfs: cleanup xfs_vn_getattr fs: add STATX_DIO_READ_ALIGN fs: reformat the statx definition

Linus Torvalds committed 1 year ago

Commit 47c9f2b2 parents 7e587c2 cf40ebb5 files · +125 −49Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/stat.h+75−24
@@ -98,43 +98,93 @@ struct statx_timestamp { · 97 unmodified lines
98 */98 */
99struct statx {99struct statx {
100 /* 0x00 */100 /* 0x00 */
101 __u32 stx_mask; /* What results were written [uncond] */101 /* What results were written [uncond] */
102 __u32 stx_blksize; /* Preferred general I/O size [uncond] */102 __u32 stx_mask;
103 __u64 stx_attributes; /* Flags conveying information about the file [uncond] */103
104 /* Preferred general I/O size [uncond] */
105 __u32 stx_blksize;
106
107 /* Flags conveying information about the file [uncond] */
108 __u64 stx_attributes;
109
104 /* 0x10 */110 /* 0x10 */
105 __u32 stx_nlink; /* Number of hard links */111 /* Number of hard links */
106 __u32 stx_uid; /* User ID of owner */112 __u32 stx_nlink;
107 __u32 stx_gid; /* Group ID of owner */113
108 __u16 stx_mode; /* File mode */114 /* User ID of owner */
115 __u32 stx_uid;
116
117 /* Group ID of owner */
118 __u32 stx_gid;
119
120 /* File mode */
121 __u16 stx_mode;
109 __u16 __spare0[1];122 __u16 __spare0[1];
123
110 /* 0x20 */124 /* 0x20 */
111 __u64 stx_ino; /* Inode number */125 /* Inode number */
112 __u64 stx_size; /* File size */126 __u64 stx_ino;
113 __u64 stx_blocks; /* Number of 512-byte blocks allocated */127
114 __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */128 /* File size */
129 __u64 stx_size;
130
131 /* Number of 512-byte blocks allocated */
132 __u64 stx_blocks;
133
134 /* Mask to show what's supported in stx_attributes */
135 __u64 stx_attributes_mask;
136
115 /* 0x40 */137 /* 0x40 */
116 struct statx_timestamp stx_atime; /* Last access time */138 /* Last access time */
117 struct statx_timestamp stx_btime; /* File creation time */139 struct statx_timestamp stx_atime;
118 struct statx_timestamp stx_ctime; /* Last attribute change time */140
119 struct statx_timestamp stx_mtime; /* Last data modification time */141 /* File creation time */
142 struct statx_timestamp stx_btime;
143
144 /* Last attribute change time */
145 struct statx_timestamp stx_ctime;
146
147 /* Last data modification time */
148 struct statx_timestamp stx_mtime;
149
120 /* 0x80 */150 /* 0x80 */
121 __u32 stx_rdev_major; /* Device ID of special file [if bdev/cdev] */151 /* Device ID of special file [if bdev/cdev] */
152 __u32 stx_rdev_major;
122 __u32 stx_rdev_minor;153 __u32 stx_rdev_minor;
123 __u32 stx_dev_major; /* ID of device containing file [uncond] */154
155 /* ID of device containing file [uncond] */
156 __u32 stx_dev_major;
124 __u32 stx_dev_minor;157 __u32 stx_dev_minor;
158
125 /* 0x90 */159 /* 0x90 */
126 __u64 stx_mnt_id;160 __u64 stx_mnt_id;
127 __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */161
128 __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */162 /* Memory buffer alignment for direct I/O */
163 __u32 stx_dio_mem_align;
164
165 /* File offset alignment for direct I/O */
166 __u32 stx_dio_offset_align;
167
129 /* 0xa0 */168 /* 0xa0 */
130 __u64 stx_subvol; /* Subvolume identifier */169 /* Subvolume identifier */
131 __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */170 __u64 stx_subvol;
132 __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */171
172 /* Min atomic write unit in bytes */
173 __u32 stx_atomic_write_unit_min;
174
175 /* Max atomic write unit in bytes */
176 __u32 stx_atomic_write_unit_max;
177
133 /* 0xb0 */178 /* 0xb0 */
134 __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */179 /* Max atomic write segment count */
135 __u32 __spare1[1];180 __u32 stx_atomic_write_segments_max;
181
182 /* File offset alignment for direct I/O reads */
183 __u32 stx_dio_read_offset_align;
184
136 /* 0xb8 */185 /* 0xb8 */
137 __u64 __spare3[9]; /* Spare space for future expansion */186 __u64 __spare3[9]; /* Spare space for future expansion */
187
138 /* 0x100 */188 /* 0x100 */
139};189};
140 190
@@ -164,6 +214,7 @@ struct statx { · 23 unmodified lines
164#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */214#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
165#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */215#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
166#define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */216#define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */
217#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */
167 218
168#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */219#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
169 220

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t