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;
28 struct ovl_layer *layer;
29 struct dentry *dentry;
32 /* private information held for overlayfs's superblock */
34 struct vfsmount *upper_mnt;
36 struct ovl_layer *lower_layers;
37 /* workbasedir is the path at workdir= mount option */
38 struct dentry *workbasedir;
39 /* workdir is the 'work' directory under workbasedir */
40 struct dentry *workdir;
41 /* index directory listing overlay inodes by origin file handle */
42 struct dentry *indexdir;
44 /* pathnames of lower and upper dirs, for show_options */
45 struct ovl_config config;
46 /* creds of process who forced instantiation of super block */
47 const struct cred *creator_cred;
50 /* sb common to all layers */
51 struct super_block *same_sb;
52 /* Did we take the inuse lock? */
57 /* private information held for every overlayfs dentry */
61 unsigned long has_upper;
67 struct ovl_path lowerstack[];
70 struct ovl_entry *ovl_alloc_entry(unsigned int numlower);
73 struct ovl_dir_cache *cache;
77 struct inode vfs_inode;
78 struct dentry *__upperdentry;
81 /* synchronize copy up and more */
85 static inline struct ovl_inode *OVL_I(struct inode *inode)
87 return container_of(inode, struct ovl_inode, vfs_inode);
90 static inline struct dentry *ovl_upperdentry_dereference(struct ovl_inode *oi)
92 return READ_ONCE(oi->__upperdentry);