mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
fs: add new vfs_poll and file_can_poll helpers
These abstract out calls to the poll method in preparation for changes in how we poll. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
parent
6e8b704df5
commit
9965ed174e
9 changed files with 32 additions and 38 deletions
|
@ -74,6 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
|
|||
pt->_key = ~(__poll_t)0; /* all events enabled */
|
||||
}
|
||||
|
||||
static inline bool file_can_poll(struct file *file)
|
||||
{
|
||||
return file->f_op->poll;
|
||||
}
|
||||
|
||||
static inline __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt)
|
||||
{
|
||||
if (unlikely(!file->f_op->poll))
|
||||
return DEFAULT_POLLMASK;
|
||||
return file->f_op->poll(file, pt);
|
||||
}
|
||||
|
||||
struct poll_table_entry {
|
||||
struct file *filp;
|
||||
__poll_t key;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue