ovl_entry.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. struct ovl_config {
  11. char *lowerdir;
  12. char *upperdir;
  13. char *workdir;
  14. bool default_permissions;
  15. bool redirect_dir;
  16. };
  17. /* private information held for overlayfs's superblock */
  18. struct ovl_fs {
  19. struct vfsmount *upper_mnt;
  20. unsigned numlower;
  21. struct vfsmount **lower_mnt;
  22. struct dentry *workdir;
  23. long namelen;
  24. /* pathnames of lower and upper dirs, for show_options */
  25. struct ovl_config config;
  26. /* creds of process who forced instantiation of super block */
  27. const struct cred *creator_cred;
  28. };
  29. /* private information held for every overlayfs dentry */
  30. struct ovl_entry {
  31. struct dentry *__upperdentry;
  32. struct ovl_dir_cache *cache;
  33. union {
  34. struct {
  35. u64 version;
  36. const char *redirect;
  37. bool opaque;
  38. };
  39. struct rcu_head rcu;
  40. };
  41. unsigned numlower;
  42. struct path lowerstack[];
  43. };
  44. struct ovl_entry *ovl_alloc_entry(unsigned int numlower);
  45. static inline struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe)
  46. {
  47. return lockless_dereference(oe->__upperdentry);
  48. }