]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - fs/aufs/poll.c
2 * Copyright (C) 2005-2017 Junjiro R. Okajima
4 * This program, aufs is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * There is only one filesystem which implements ->poll operation, currently.
25 unsigned int aufs_poll(struct file
*file
, poll_table
*wait
)
30 struct super_block
*sb
;
32 /* We should pretend an error happened. */
33 mask
= POLLERR
/* | POLLIN | POLLOUT */;
34 sb
= file
->f_path
.dentry
->d_sb
;
35 si_read_lock(sb
, AuLock_FLUSH
| AuLock_NOPLMW
);
37 h_file
= au_read_pre(file
, /*keep_fi*/0, /*lsc*/0);
38 err
= PTR_ERR(h_file
);
42 /* it is not an error if h_file has no operation */
43 mask
= DEFAULT_POLLMASK
;
44 if (h_file
->f_op
->poll
)
45 mask
= h_file
->f_op
->poll(h_file
, wait
);
46 fput(h_file
); /* instead of au_read_post() */
50 AuTraceErr((int)mask
);