]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - fs/overlayfs/ovl_entry.h
Merge tag 'md/4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
[mirror_ubuntu-bionic-kernel.git] / fs / overlayfs / ovl_entry.h
CommitLineData
bbb1e54d
MS
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
11struct ovl_config {
12 char *lowerdir;
13 char *upperdir;
14 char *workdir;
15 bool default_permissions;
a6c60655 16 bool redirect_dir;
bbb1e54d
MS
17};
18
19/* private information held for overlayfs's superblock */
20struct ovl_fs {
21 struct vfsmount *upper_mnt;
22 unsigned numlower;
23 struct vfsmount **lower_mnt;
24 struct dentry *workdir;
6b2d5fe4 25 long namelen;
bbb1e54d
MS
26 /* pathnames of lower and upper dirs, for show_options */
27 struct ovl_config config;
28 /* creds of process who forced instantiation of super block */
29 const struct cred *creator_cred;
e7f52429 30 bool tmpfile;
82b749b2 31 bool noxattr;
39d3d60a 32 wait_queue_head_t copyup_wq;
7bcd74b9
AG
33 /* sb common to all layers */
34 struct super_block *same_sb;
bbb1e54d
MS
35};
36
37/* private information held for every overlayfs dentry */
38struct ovl_entry {
39 struct dentry *__upperdentry;
40 struct ovl_dir_cache *cache;
41 union {
42 struct {
43 u64 version;
02b69b28 44 const char *redirect;
bbb1e54d 45 bool opaque;
ee1d6d37 46 bool impure;
39d3d60a 47 bool copying;
bbb1e54d
MS
48 };
49 struct rcu_head rcu;
50 };
51 unsigned numlower;
52 struct path lowerstack[];
53};
54
55struct ovl_entry *ovl_alloc_entry(unsigned int numlower);
56
57static inline struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe)
58{
59 return lockless_dereference(oe->__upperdentry);
60}