3 * Copyright (C) 2011 Novell Inc.
4 * Copyright (C) 2016 Red Hat, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
15 bool default_permissions
;
18 const char *redirect_mode
;
26 /* Index of this layer in fs root (upper == 0) */
31 struct ovl_layer
*layer
;
32 struct dentry
*dentry
;
35 /* private information held for overlayfs's superblock */
37 struct vfsmount
*upper_mnt
;
39 struct ovl_layer
*lower_layers
;
40 /* workbasedir is the path at workdir= mount option */
41 struct dentry
*workbasedir
;
42 /* workdir is the 'work' directory under workbasedir */
43 struct dentry
*workdir
;
44 /* index directory listing overlay inodes by origin file handle */
45 struct dentry
*indexdir
;
47 /* pathnames of lower and upper dirs, for show_options */
48 struct ovl_config config
;
49 /* creds of process who forced instantiation of super block */
50 const struct cred
*creator_cred
;
53 /* sb common to all layers */
54 struct super_block
*same_sb
;
55 /* Did we take the inuse lock? */
60 /* private information held for every overlayfs dentry */
69 struct ovl_path lowerstack
[];
72 struct ovl_entry
*ovl_alloc_entry(unsigned int numlower
);
74 static inline struct ovl_entry
*OVL_E(struct dentry
*dentry
)
76 return (struct ovl_entry
*) dentry
->d_fsdata
;
80 struct ovl_dir_cache
*cache
;
84 struct inode vfs_inode
;
85 struct dentry
*__upperdentry
;
88 /* synchronize copy up and more */
92 static inline struct ovl_inode
*OVL_I(struct inode
*inode
)
94 return container_of(inode
, struct ovl_inode
, vfs_inode
);
97 static inline struct dentry
*ovl_upperdentry_dereference(struct ovl_inode
*oi
)
99 return READ_ONCE(oi
->__upperdentry
);