2 * Copyright (C) 2010-2013 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
20 * special support for filesystems which aqucires an inode mutex
21 * at final closing a file, eg, hfsplus.
23 * This trick is very simple and stupid, just to open the file before really
24 * neceeary open to tell hfsplus that this is not the final closing.
25 * The caller should call au_h_open_pre() after acquiring the inode mutex,
26 * and au_h_open_post() after releasing it.
31 struct file *au_h_open_pre(struct dentry *dentry, aufs_bindex_t bindex)
34 struct dentry *h_dentry;
36 h_dentry = au_h_dptr(dentry, bindex);
38 AuDebugOn(!h_dentry->d_inode);
41 if (au_test_hfsplus(h_dentry->d_sb)
42 && S_ISREG(h_dentry->d_inode->i_mode))
43 h_file = au_h_open(dentry, bindex,
44 O_RDONLY | O_NOATIME | O_LARGEFILE,
49 void au_h_open_post(struct dentry *dentry, aufs_bindex_t bindex,
54 au_sbr_put(dentry->d_sb, bindex);