History

add unique mount ID

If a mount is released then its mnt_id can immediately be reused. This is bad news for user interfaces that want to uniquely identify a mount. Implementing a unique mount ID is trivial (use a 64bit counter). Unfortunately userspace assumes 32bit size and would overflow after the counter reaches 2^32. Introduce a new 64bit ID alongside the old one. Initialize the counter to 2^32, this guarantees that the old and new IDs are never mixed up.

Miklos Szeredi committed 3 years ago

Commit 98d2b431 parent b85ea954 files · +14 −3Browse files

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

Unified · Split

include/uapi/linux/stat.h+1−0
@@ -154,6 +154,7 @@ struct statx { · 153 unmodified lines
154154 #define STATX_BTIME 0x00000800U /* Want/got stx_btime */
155155 #define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
156156 #define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
157+#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
157158
158159 #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
159160

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