cifs: fix chown and chgrp when idsfromsid mount option enabled
[linux-2.6-microblaze.git] / include / linux / proc_fs.h
index ad4ff71..d1eed1b 100644 (file)
@@ -42,6 +42,34 @@ struct proc_ops {
        unsigned long (*proc_get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
 } __randomize_layout;
 
+/* definitions for hide_pid field */
+enum proc_hidepid {
+       HIDEPID_OFF       = 0,
+       HIDEPID_NO_ACCESS = 1,
+       HIDEPID_INVISIBLE = 2,
+       HIDEPID_NOT_PTRACEABLE = 4, /* Limit pids to only ptraceable pids */
+};
+
+/* definitions for proc mount option pidonly */
+enum proc_pidonly {
+       PROC_PIDONLY_OFF = 0,
+       PROC_PIDONLY_ON  = 1,
+};
+
+struct proc_fs_info {
+       struct pid_namespace *pid_ns;
+       struct dentry *proc_self;        /* For /proc/self */
+       struct dentry *proc_thread_self; /* For /proc/thread-self */
+       kgid_t pid_gid;
+       enum proc_hidepid hide_pid;
+       enum proc_pidonly pidonly;
+};
+
+static inline struct proc_fs_info *proc_sb_info(struct super_block *sb)
+{
+       return sb->s_fs_info;
+}
+
 #ifdef CONFIG_PROC_FS
 
 typedef int (*proc_write_t)(struct file *, char *, size_t);
@@ -177,9 +205,9 @@ int open_related_ns(struct ns_common *ns,
                   struct ns_common *(*get_ns)(struct ns_common *ns));
 
 /* get the associated pid namespace for a file in procfs */
-static inline struct pid_namespace *proc_pid_ns(const struct inode *inode)
+static inline struct pid_namespace *proc_pid_ns(struct super_block *sb)
 {
-       return inode->i_sb->s_fs_info;
+       return proc_sb_info(sb)->pid_ns;
 }
 
 bool proc_ns_file(const struct file *file);