Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0858caa

Browse files
committed
uapi: General notification queue definitions
Add UAPI definitions for the general notification queue, including thefollowing pieces: (*) struct watch_notification. This is the metadata header for notification messages. It includes a type and subtype that indicate the source of the message (eg. WATCH_TYPE_MOUNT_NOTIFY) and the kind of the message (eg. NOTIFY_MOUNT_NEW_MOUNT). The header also contains an information field that conveys the following information:- WATCH_INFO_LENGTH. The size of the entry (entries are variable length).- WATCH_INFO_ID. The watch ID specified when the watchpoint was set.- WATCH_INFO_TYPE_INFO. (Sub)type-specific information.- WATCH_INFO_FLAG_*. Flag bits overlain on the type-specific information. For use by the type. All the information in the header can be used in filtering messages at the point of writing into the buffer. (*) struct watch_notification_removal This is an extended watch-removal notification record that includes an 'id' field that can indicate the identifier of the object being removed if available (for instance, a keyring serial number).Signed-off-by: David Howells <dhowells@redhat.com>
1 parentb9bbe6e commit0858caa

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

‎include/uapi/linux/watch_queue.h‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
#ifndef_UAPI_LINUX_WATCH_QUEUE_H
3+
#define_UAPI_LINUX_WATCH_QUEUE_H
4+
5+
#include<linux/types.h>
6+
7+
enumwatch_notification_type {
8+
WATCH_TYPE_META=0,/* Special record */
9+
WATCH_TYPE__NR=1
10+
};
11+
12+
enumwatch_meta_notification_subtype {
13+
WATCH_META_REMOVAL_NOTIFICATION=0,/* Watched object was removed */
14+
WATCH_META_LOSS_NOTIFICATION=1,/* Data loss occurred */
15+
};
16+
17+
/*
18+
* Notification record header. This is aligned to 64-bits so that subclasses
19+
* can contain __u64 fields.
20+
*/
21+
structwatch_notification {
22+
__u32type:24;/* enum watch_notification_type */
23+
__u32subtype:8;/* Type-specific subtype (filterable) */
24+
__u32info;
25+
#defineWATCH_INFO_LENGTH0x0000007f/* Length of record */
26+
#defineWATCH_INFO_LENGTH__SHIFT 0
27+
#defineWATCH_INFO_ID0x0000ff00/* ID of watchpoint */
28+
#defineWATCH_INFO_ID__SHIFT8
29+
#defineWATCH_INFO_TYPE_INFO0xffff0000/* Type-specific info */
30+
#defineWATCH_INFO_TYPE_INFO__SHIFT 16
31+
#defineWATCH_INFO_FLAG_00x00010000/* Type-specific info, flag bit 0 */
32+
#defineWATCH_INFO_FLAG_10x00020000/* ... */
33+
#defineWATCH_INFO_FLAG_20x00040000
34+
#defineWATCH_INFO_FLAG_30x00080000
35+
#defineWATCH_INFO_FLAG_40x00100000
36+
#defineWATCH_INFO_FLAG_50x00200000
37+
#defineWATCH_INFO_FLAG_60x00400000
38+
#defineWATCH_INFO_FLAG_70x00800000
39+
};
40+
41+
42+
/*
43+
* Extended watch removal notification. This is used optionally if the type
44+
* wants to indicate an identifier for the object being watched, if there is
45+
* such. This can be distinguished by the length.
46+
*
47+
* type -> WATCH_TYPE_META
48+
* subtype -> WATCH_META_REMOVAL_NOTIFICATION
49+
*/
50+
structwatch_notification_removal {
51+
structwatch_notificationwatch;
52+
__u64id;/* Type-dependent identifier */
53+
};
54+
55+
#endif/* _UAPI_LINUX_WATCH_QUEUE_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp