New IOCTL and macros has been added in the kernel sources. Update the tools header file as well.
Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -305,4 +305,63 @@ typedef int __bitwise __kernel_rwf_t; · 304 unmodified lines | |||
| 305 | #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ | 305 | #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ |
| 306 | RWF_APPEND) | 306 | RWF_APPEND) |
| 307 | 307 | ||
| 308 | /* Pagemap ioctl */ | ||
| 309 | #define PAGEMAP_SCAN _IOWR('f', 16, struct pm_scan_arg) | ||
| 310 | |||
| 311 | /* Bitmasks provided in pm_scan_args masks and reported in page_region.categories. */ | ||
| 312 | #define PAGE_IS_WPALLOWED (1 << 0) | ||
| 313 | #define PAGE_IS_WRITTEN (1 << 1) | ||
| 314 | #define PAGE_IS_FILE (1 << 2) | ||
| 315 | #define PAGE_IS_PRESENT (1 << 3) | ||
| 316 | #define PAGE_IS_SWAPPED (1 << 4) | ||
| 317 | #define PAGE_IS_PFNZERO (1 << 5) | ||
| 318 | #define PAGE_IS_HUGE (1 << 6) | ||
| 319 | |||
| 320 | /* | ||
| 321 | * struct page_region - Page region with flags | ||
| 322 | * @start: Start of the region | ||
| 323 | * @end: End of the region (exclusive) | ||
| 324 | * @categories: PAGE_IS_* category bitmask for the region | ||
| 325 | */ | ||
| 326 | struct page_region { | ||
| 327 | __u64 start; | ||
| 328 | __u64 end; | ||
| 329 | __u64 categories; | ||
| 330 | }; | ||
| 331 | |||
| 332 | /* Flags for PAGEMAP_SCAN ioctl */ | ||
| 333 | #define PM_SCAN_WP_MATCHING (1 << 0) /* Write protect the pages matched. */ | ||
| 334 | #define PM_SCAN_CHECK_WPASYNC (1 << 1) /* Abort the scan when a non-WP-enabled page is found. */ | ||
| 335 | |||
| 336 | /* | ||
| 337 | * struct pm_scan_arg - Pagemap ioctl argument | ||
| 338 | * @size: Size of the structure | ||
| 339 | * @flags: Flags for the IOCTL | ||
| 340 | * @start: Starting address of the region | ||
| 341 | * @end: Ending address of the region | ||
| 342 | * @walk_end Address where the scan stopped (written by kernel). | ||
| 343 | * walk_end == end (address tags cleared) informs that the scan completed on entire range. | ||
| 344 | * @vec: Address of page_region struct array for output | ||
| 345 | * @vec_len: Length of the page_region struct array | ||
| 346 | * @max_pages: Optional limit for number of returned pages (0 = disabled) | ||
| 347 | * @category_inverted: PAGE_IS_* categories which values match if 0 instead of 1 | ||
| 348 | * @category_mask: Skip pages for which any category doesn't match | ||
| 349 | * @category_anyof_mask: Skip pages for which no category matches | ||
| 350 | * @return_mask: PAGE_IS_* categories that are to be reported in `page_region`s returned | ||
| 351 | */ | ||
| 352 | struct pm_scan_arg { | ||
| 353 | __u64 size; | ||
| 354 | __u64 flags; | ||
| 355 | __u64 start; | ||
| 356 | __u64 end; | ||
| 357 | __u64 walk_end; | ||
| 358 | __u64 vec; | ||
| 359 | __u64 vec_len; | ||
| 360 | __u64 max_pages; | ||
| 361 | __u64 category_inverted; | ||
| 362 | __u64 category_mask; | ||
| 363 | __u64 category_anyof_mask; | ||
| 364 | __u64 return_mask; | ||
| 365 | }; | ||
| 366 | |||
| 308 | #endif /* _UAPI_LINUX_FS_H */ | 367 | #endif /* _UAPI_LINUX_FS_H */ |