Commit f97df70b authored by Seth Forshee's avatar Seth Forshee Committed by Juergen Gross

xenfs: Use proc_create_mount_point() to create /proc/xen

Mounting proc in user namespace containers fails if the xenbus
filesystem is mounted on /proc/xen because this directory fails
the "permanently empty" test. proc_create_mount_point() exists
specifically to create such mountpoints in proc but is currently
proc-internal. Export this interface to modules, then use it in
xenbus when creating /proc/xen.
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 1ea55e80
...@@ -826,7 +826,7 @@ static int __init xenbus_init(void) ...@@ -826,7 +826,7 @@ static int __init xenbus_init(void)
* Create xenfs mountpoint in /proc for compatibility with * Create xenfs mountpoint in /proc for compatibility with
* utilities that expect to find "xenbus" under "/proc/xen". * utilities that expect to find "xenbus" under "/proc/xen".
*/ */
proc_mkdir("xen", NULL); proc_create_mount_point("xen");
#endif #endif
out_error: out_error:
......
...@@ -479,6 +479,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name) ...@@ -479,6 +479,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name)
} }
return ent; return ent;
} }
EXPORT_SYMBOL(proc_create_mount_point);
struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
struct proc_dir_entry *parent, struct proc_dir_entry *parent,
......
...@@ -195,7 +195,6 @@ static inline bool is_empty_pde(const struct proc_dir_entry *pde) ...@@ -195,7 +195,6 @@ static inline bool is_empty_pde(const struct proc_dir_entry *pde)
{ {
return S_ISDIR(pde->mode) && !pde->proc_iops; return S_ISDIR(pde->mode) && !pde->proc_iops;
} }
struct proc_dir_entry *proc_create_mount_point(const char *name);
/* /*
* inode.c * inode.c
......
...@@ -21,6 +21,7 @@ extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t, ...@@ -21,6 +21,7 @@ extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
struct proc_dir_entry *, void *); struct proc_dir_entry *, void *);
extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t, extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
struct proc_dir_entry *); struct proc_dir_entry *);
struct proc_dir_entry *proc_create_mount_point(const char *name);
extern struct proc_dir_entry *proc_create_data(const char *, umode_t, extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
struct proc_dir_entry *, struct proc_dir_entry *,
...@@ -56,6 +57,7 @@ static inline struct proc_dir_entry *proc_symlink(const char *name, ...@@ -56,6 +57,7 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
struct proc_dir_entry *parent,const char *dest) { return NULL;} struct proc_dir_entry *parent,const char *dest) { return NULL;}
static inline struct proc_dir_entry *proc_mkdir(const char *name, static inline struct proc_dir_entry *proc_mkdir(const char *name,
struct proc_dir_entry *parent) {return NULL;} struct proc_dir_entry *parent) {return NULL;}
static inline struct proc_dir_entry *proc_create_mount_point(const char *name) { return NULL; }
static inline struct proc_dir_entry *proc_mkdir_data(const char *name, static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; } umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment