// SPDX-License-Identifier: GPL-2.0 /* User-mappable watch queue * * Copyright (C) 2020 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * See Documentation/core-api/watch_queue.rst
*/
struct watch_type_filter { enum watch_notification_type type;
__u32 subtype_filter[1]; /* Bitmask of subtypes to filter on */
__u32 info_filter; /* Filter on watch_notification::info */
__u32 info_mask; /* Mask of relevant bits in info_filter */
};
struct watch_filter { union { struct rcu_head rcu; /* Bitmask of accepted types */
DECLARE_BITMAP(type_filter, WATCH_TYPE__NR);
};
u32 nr_filters; /* Number of filters */ struct watch_type_filter filters[] __counted_by(nr_filters);
};
struct watch_queue { struct rcu_head rcu; struct watch_filter __rcu *filter; struct pipe_inode_info *pipe; /* Pipe we use as a buffer, NULL if queue closed */ struct hlist_head watches; /* Contributory watches */ struct page **notes; /* Preallocated notifications */ unsignedlong *notes_bitmap; /* Allocation bitmap for notes */ struct kref usage; /* Object usage count */
spinlock_t lock; unsignedint nr_notes; /* Number of notes */ unsignedint nr_pages; /* Number of pages in notes[] */
};
/* * Representation of a watch on an object.
*/ struct watch { union { struct rcu_head rcu;
u32 info_id; /* ID to be OR'd in to info field */
}; struct watch_queue __rcu *queue; /* Queue to post events to */ struct hlist_node queue_node; /* Link in queue->watches */ struct watch_list __rcu *watch_list; struct hlist_node list_node; /* Link in watch_list->watchers */ conststruct cred *cred; /* Creds of the owner of the watch */ void *private; /* Private data for the watched object */
u64 id; /* Internal identifier */ struct kref usage; /* Object usage count */
};
/* * List of watches on an object.
*/ struct watch_list { struct rcu_head rcu; struct hlist_head watchers; void (*release_watch)(struct watch *);
spinlock_t lock;
};
/** * watch_sizeof - Calculate the information part of the size of a watch record, * given the structure size.
*/ #define watch_sizeof(STRUCT) (sizeof(STRUCT) << WATCH_INFO_LENGTH__SHIFT)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.