2 * Copyright (C) 2005-2012 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, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 * There is only one filesystem which implements ->poll operation, currently.
26 unsigned int aufs_poll(struct file *file, poll_table *wait)
31 struct dentry *dentry;
32 struct super_block *sb;
34 /* We should pretend an error happened. */
35 mask = POLLERR /* | POLLIN | POLLOUT */;
36 dentry = file->f_dentry;
38 si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
39 err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0);
43 /* it is not an error if h_file has no operation */
44 mask = DEFAULT_POLLMASK;
45 h_file = au_hf_top(file);
46 if (h_file->f_op && h_file->f_op->poll)
47 mask = h_file->f_op->poll(h_file, wait);
49 di_read_unlock(dentry, AuLock_IR);
54 AuTraceErr((int)mask);