Miklos Szeredi | bbb1e54 | 2016-12-16 11:02:56 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright (C) 2011 Novell Inc. |
| 4 | * Copyright (C) 2016 Red Hat, Inc. |
| 5 | * |
| 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. |
| 9 | */ |
| 10 | |
| 11 | struct ovl_config { |
| 12 | char *lowerdir; |
| 13 | char *upperdir; |
| 14 | char *workdir; |
| 15 | bool default_permissions; |
| 16 | }; |
| 17 | |
| 18 | /* private information held for overlayfs's superblock */ |
| 19 | struct ovl_fs { |
| 20 | struct vfsmount *upper_mnt; |
| 21 | unsigned numlower; |
| 22 | struct vfsmount **lower_mnt; |
| 23 | struct dentry *workdir; |
Miklos Szeredi | 6b2d5fe | 2016-12-16 11:02:56 +0100 | [diff] [blame^] | 24 | long namelen; |
Miklos Szeredi | bbb1e54 | 2016-12-16 11:02:56 +0100 | [diff] [blame] | 25 | /* pathnames of lower and upper dirs, for show_options */ |
| 26 | struct ovl_config config; |
| 27 | /* creds of process who forced instantiation of super block */ |
| 28 | const struct cred *creator_cred; |
| 29 | }; |
| 30 | |
| 31 | /* private information held for every overlayfs dentry */ |
| 32 | struct ovl_entry { |
| 33 | struct dentry *__upperdentry; |
| 34 | struct ovl_dir_cache *cache; |
| 35 | union { |
| 36 | struct { |
| 37 | u64 version; |
| 38 | bool opaque; |
| 39 | }; |
| 40 | struct rcu_head rcu; |
| 41 | }; |
| 42 | unsigned numlower; |
| 43 | struct path lowerstack[]; |
| 44 | }; |
| 45 | |
| 46 | struct ovl_entry *ovl_alloc_entry(unsigned int numlower); |
| 47 | |
| 48 | static inline struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe) |
| 49 | { |
| 50 | return lockless_dereference(oe->__upperdentry); |
| 51 | } |