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;
24 struct super_block *sb;
31 /* Index of this layer in fs root (upper idx == 0) */
33 /* One fsid per unique underlying sb (upper fsid == 0) */
38 struct ovl_layer *layer;
39 struct dentry *dentry;
42 /* private information held for overlayfs's superblock */
44 struct vfsmount *upper_mnt;
45 unsigned int numlower;
46 /* Number of unique lower sb that differ from upper sb */
47 unsigned int numlowerfs;
48 struct ovl_layer *lower_layers;
49 struct ovl_sb *lower_fs;
50 /* workbasedir is the path at workdir= mount option */
51 struct dentry *workbasedir;
52 /* workdir is the 'work' directory under workbasedir */
53 struct dentry *workdir;
54 /* index directory listing overlay inodes by origin file handle */
55 struct dentry *indexdir;
57 /* pathnames of lower and upper dirs, for show_options */
58 struct ovl_config config;
59 /* creds of process who forced instantiation of super block */
60 const struct cred *creator_cred;
63 /* Did we take the inuse lock? */
68 /* private information held for every overlayfs dentry */
77 struct ovl_path lowerstack[];
80 struct ovl_entry *ovl_alloc_entry(unsigned int numlower);
82 static inline struct ovl_entry *OVL_E(struct dentry *dentry)
84 return (struct ovl_entry *) dentry->d_fsdata;
88 struct ovl_dir_cache *cache;
92 struct inode vfs_inode;
93 struct dentry *__upperdentry;
96 /* synchronize copy up and more */
100 static inline struct ovl_inode *OVL_I(struct inode *inode)
102 return container_of(inode, struct ovl_inode, vfs_inode);
105 static inline struct dentry *ovl_upperdentry_dereference(struct ovl_inode *oi)
107 return READ_ONCE(oi->__upperdentry);