aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-24 03:36:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:54:56 -0500
commitd161a13f974c72fd7ff0069d39a3ae57cb5694ff (patch)
tree0c6d6237b3eafbe362798d7727a02f509fd72ca9
parent587a1f1659e8b330b8738ef4901832a2b63f0bed (diff)
switch procfs to umode_t use
both proc_dir_entry ->mode and populating functions Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/powerpc/kernel/lparcfg.c2
-rw-r--r--drivers/acpi/battery.c2
-rw-r--r--drivers/message/i2o/i2o_proc.c2
-rw-r--r--drivers/misc/sgi-gru/gruprocfs.c2
-rw-r--r--drivers/platform/x86/asus_acpi.c4
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c4
-rw-r--r--drivers/scsi/sg.c7
-rw-r--r--fs/proc/base.c2
-rw-r--r--fs/proc/generic.c8
-rw-r--r--fs/proc/proc_net.c2
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/proc_fs.h24
-rw-r--r--include/sound/info.h2
13 files changed, 31 insertions, 32 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 84daabe2fcba..578f35f18723 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -783,7 +783,7 @@ static const struct file_operations lparcfg_fops = {
783static int __init lparcfg_init(void) 783static int __init lparcfg_init(void)
784{ 784{
785 struct proc_dir_entry *ent; 785 struct proc_dir_entry *ent;
786 mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 786 umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
787 787
788 /* Allow writing if we have FW_FEATURE_SPLPAR */ 788 /* Allow writing if we have FW_FEATURE_SPLPAR */
789 if (firmware_has_feature(FW_FEATURE_SPLPAR) && 789 if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 7711d94a0409..86933ca8b472 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -873,7 +873,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
873 873
874static const struct battery_file { 874static const struct battery_file {
875 struct file_operations ops; 875 struct file_operations ops;
876 mode_t mode; 876 umode_t mode;
877 const char *name; 877 const char *name;
878} acpi_battery_file[] = { 878} acpi_battery_file[] = {
879 FILE_DESCRIPTION_RO(info), 879 FILE_DESCRIPTION_RO(info),
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 07dbeaf9df99..6d115c7208ab 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -56,7 +56,7 @@
56/* Structure used to define /proc entries */ 56/* Structure used to define /proc entries */
57typedef struct _i2o_proc_entry_t { 57typedef struct _i2o_proc_entry_t {
58 char *name; /* entry name */ 58 char *name; /* entry name */
59 mode_t mode; /* mode */ 59 umode_t mode; /* mode */
60 const struct file_operations *fops; /* open function */ 60 const struct file_operations *fops; /* open function */
61} i2o_proc_entry; 61} i2o_proc_entry;
62 62
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
index 7768b87d995b..950dbe9ecb36 100644
--- a/drivers/misc/sgi-gru/gruprocfs.c
+++ b/drivers/misc/sgi-gru/gruprocfs.c
@@ -324,7 +324,7 @@ static const struct file_operations gru_fops = {
324 324
325static struct proc_entry { 325static struct proc_entry {
326 char *name; 326 char *name;
327 int mode; 327 umode_t mode;
328 const struct file_operations *fops; 328 const struct file_operations *fops;
329 struct proc_dir_entry *entry; 329 struct proc_dir_entry *entry;
330} proc_files[] = { 330} proc_files[] = {
diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
index d9312b3073e5..6f966d6c062b 100644
--- a/drivers/platform/x86/asus_acpi.c
+++ b/drivers/platform/x86/asus_acpi.c
@@ -1053,7 +1053,7 @@ static const struct file_operations disp_proc_fops = {
1053}; 1053};
1054 1054
1055static int 1055static int
1056asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode, 1056asus_proc_add(char *name, const struct file_operations *proc_fops, umode_t mode,
1057 struct acpi_device *device) 1057 struct acpi_device *device)
1058{ 1058{
1059 struct proc_dir_entry *proc; 1059 struct proc_dir_entry *proc;
@@ -1072,7 +1072,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode,
1072static int asus_hotk_add_fs(struct acpi_device *device) 1072static int asus_hotk_add_fs(struct acpi_device *device)
1073{ 1073{
1074 struct proc_dir_entry *proc; 1074 struct proc_dir_entry *proc;
1075 mode_t mode; 1075 umode_t mode;
1076 1076
1077 if ((asus_uid == 0) && (asus_gid == 0)) { 1077 if ((asus_uid == 0) && (asus_gid == 0)) {
1078 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP; 1078 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 7b828680b21d..455e1522253e 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -297,7 +297,7 @@ struct ibm_init_struct {
297 char param[32]; 297 char param[32];
298 298
299 int (*init) (struct ibm_init_struct *); 299 int (*init) (struct ibm_init_struct *);
300 mode_t base_procfs_mode; 300 umode_t base_procfs_mode;
301 struct ibm_struct *data; 301 struct ibm_struct *data;
302}; 302};
303 303
@@ -8542,7 +8542,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
8542 "%s installed\n", ibm->name); 8542 "%s installed\n", ibm->name);
8543 8543
8544 if (ibm->read) { 8544 if (ibm->read) {
8545 mode_t mode = iibm->base_procfs_mode; 8545 umode_t mode = iibm->base_procfs_mode;
8546 8546
8547 if (!mode) 8547 if (!mode)
8548 mode = S_IRUGO; 8548 mode = S_IRUGO;
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 441a1c5b8974..02d99982a74d 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -2325,16 +2325,15 @@ static struct sg_proc_leaf sg_proc_leaf_arr[] = {
2325static int 2325static int
2326sg_proc_init(void) 2326sg_proc_init(void)
2327{ 2327{
2328 int k, mask;
2329 int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr); 2328 int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr);
2330 struct sg_proc_leaf * leaf; 2329 int k;
2331 2330
2332 sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL); 2331 sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
2333 if (!sg_proc_sgp) 2332 if (!sg_proc_sgp)
2334 return 1; 2333 return 1;
2335 for (k = 0; k < num_leaves; ++k) { 2334 for (k = 0; k < num_leaves; ++k) {
2336 leaf = &sg_proc_leaf_arr[k]; 2335 struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k];
2337 mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; 2336 umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO;
2338 proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); 2337 proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops);
2339 } 2338 }
2340 return 0; 2339 return 0;
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 851ba3dcdc29..65054d38ca23 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -101,7 +101,7 @@
101struct pid_entry { 101struct pid_entry {
102 char *name; 102 char *name;
103 int len; 103 int len;
104 mode_t mode; 104 umode_t mode;
105 const struct inode_operations *iop; 105 const struct inode_operations *iop;
106 const struct file_operations *fop; 106 const struct file_operations *fop;
107 union proc_op op; 107 union proc_op op;
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 10090d9c7ad5..2edf34f2eb61 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -597,7 +597,7 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp
597 597
598static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent, 598static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
599 const char *name, 599 const char *name,
600 mode_t mode, 600 umode_t mode,
601 nlink_t nlink) 601 nlink_t nlink)
602{ 602{
603 struct proc_dir_entry *ent = NULL; 603 struct proc_dir_entry *ent = NULL;
@@ -659,7 +659,7 @@ struct proc_dir_entry *proc_symlink(const char *name,
659} 659}
660EXPORT_SYMBOL(proc_symlink); 660EXPORT_SYMBOL(proc_symlink);
661 661
662struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, 662struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
663 struct proc_dir_entry *parent) 663 struct proc_dir_entry *parent)
664{ 664{
665 struct proc_dir_entry *ent; 665 struct proc_dir_entry *ent;
@@ -699,7 +699,7 @@ struct proc_dir_entry *proc_mkdir(const char *name,
699} 699}
700EXPORT_SYMBOL(proc_mkdir); 700EXPORT_SYMBOL(proc_mkdir);
701 701
702struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 702struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
703 struct proc_dir_entry *parent) 703 struct proc_dir_entry *parent)
704{ 704{
705 struct proc_dir_entry *ent; 705 struct proc_dir_entry *ent;
@@ -728,7 +728,7 @@ struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
728} 728}
729EXPORT_SYMBOL(create_proc_entry); 729EXPORT_SYMBOL(create_proc_entry);
730 730
731struct proc_dir_entry *proc_create_data(const char *name, mode_t mode, 731struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
732 struct proc_dir_entry *parent, 732 struct proc_dir_entry *parent,
733 const struct file_operations *proc_fops, 733 const struct file_operations *proc_fops,
734 void *data) 734 void *data)
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index f738024ccc8e..06e1cc17caf6 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -179,7 +179,7 @@ const struct file_operations proc_net_operations = {
179 179
180 180
181struct proc_dir_entry *proc_net_fops_create(struct net *net, 181struct proc_dir_entry *proc_net_fops_create(struct net *net,
182 const char *name, mode_t mode, const struct file_operations *fops) 182 const char *name, umode_t mode, const struct file_operations *fops)
183{ 183{
184 return proc_create(name, mode, net->proc_net, fops); 184 return proc_create(name, mode, net->proc_net, fops);
185} 185}
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 42557851b12e..501370b61ee5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -920,7 +920,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
920 920
921typedef struct { 921typedef struct {
922 const char *name; 922 const char *name;
923 mode_t mode; 923 umode_t mode;
924 const struct file_operations *proc_fops; 924 const struct file_operations *proc_fops;
925} ide_proc_entry_t; 925} ide_proc_entry_t;
926 926
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 643b96c7a94f..6d9e575519cc 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -50,7 +50,7 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer,
50 50
51struct proc_dir_entry { 51struct proc_dir_entry {
52 unsigned int low_ino; 52 unsigned int low_ino;
53 mode_t mode; 53 umode_t mode;
54 nlink_t nlink; 54 nlink_t nlink;
55 uid_t uid; 55 uid_t uid;
56 gid_t gid; 56 gid_t gid;
@@ -106,9 +106,9 @@ extern void proc_root_init(void);
106 106
107void proc_flush_task(struct task_struct *task); 107void proc_flush_task(struct task_struct *task);
108 108
109extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 109extern struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
110 struct proc_dir_entry *parent); 110 struct proc_dir_entry *parent);
111struct proc_dir_entry *proc_create_data(const char *name, mode_t mode, 111struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
112 struct proc_dir_entry *parent, 112 struct proc_dir_entry *parent,
113 const struct file_operations *proc_fops, 113 const struct file_operations *proc_fops,
114 void *data); 114 void *data);
@@ -146,17 +146,17 @@ extern void proc_device_tree_update_prop(struct proc_dir_entry *pde,
146extern struct proc_dir_entry *proc_symlink(const char *, 146extern struct proc_dir_entry *proc_symlink(const char *,
147 struct proc_dir_entry *, const char *); 147 struct proc_dir_entry *, const char *);
148extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); 148extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
149extern struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, 149extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
150 struct proc_dir_entry *parent); 150 struct proc_dir_entry *parent);
151 151
152static inline struct proc_dir_entry *proc_create(const char *name, mode_t mode, 152static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
153 struct proc_dir_entry *parent, const struct file_operations *proc_fops) 153 struct proc_dir_entry *parent, const struct file_operations *proc_fops)
154{ 154{
155 return proc_create_data(name, mode, parent, proc_fops, NULL); 155 return proc_create_data(name, mode, parent, proc_fops, NULL);
156} 156}
157 157
158static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 158static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
159 mode_t mode, struct proc_dir_entry *base, 159 umode_t mode, struct proc_dir_entry *base,
160 read_proc_t *read_proc, void * data) 160 read_proc_t *read_proc, void * data)
161{ 161{
162 struct proc_dir_entry *res=create_proc_entry(name,mode,base); 162 struct proc_dir_entry *res=create_proc_entry(name,mode,base);
@@ -168,7 +168,7 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
168} 168}
169 169
170extern struct proc_dir_entry *proc_net_fops_create(struct net *net, 170extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
171 const char *name, mode_t mode, const struct file_operations *fops); 171 const char *name, umode_t mode, const struct file_operations *fops);
172extern void proc_net_remove(struct net *net, const char *name); 172extern void proc_net_remove(struct net *net, const char *name);
173extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, 173extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
174 struct proc_dir_entry *parent); 174 struct proc_dir_entry *parent);
@@ -185,15 +185,15 @@ static inline void proc_flush_task(struct task_struct *task)
185} 185}
186 186
187static inline struct proc_dir_entry *create_proc_entry(const char *name, 187static inline struct proc_dir_entry *create_proc_entry(const char *name,
188 mode_t mode, struct proc_dir_entry *parent) { return NULL; } 188 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
189static inline struct proc_dir_entry *proc_create(const char *name, 189static inline struct proc_dir_entry *proc_create(const char *name,
190 mode_t mode, struct proc_dir_entry *parent, 190 umode_t mode, struct proc_dir_entry *parent,
191 const struct file_operations *proc_fops) 191 const struct file_operations *proc_fops)
192{ 192{
193 return NULL; 193 return NULL;
194} 194}
195static inline struct proc_dir_entry *proc_create_data(const char *name, 195static inline struct proc_dir_entry *proc_create_data(const char *name,
196 mode_t mode, struct proc_dir_entry *parent, 196 umode_t mode, struct proc_dir_entry *parent,
197 const struct file_operations *proc_fops, void *data) 197 const struct file_operations *proc_fops, void *data)
198{ 198{
199 return NULL; 199 return NULL;
@@ -205,10 +205,10 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
205static inline struct proc_dir_entry *proc_mkdir(const char *name, 205static inline struct proc_dir_entry *proc_mkdir(const char *name,
206 struct proc_dir_entry *parent) {return NULL;} 206 struct proc_dir_entry *parent) {return NULL;}
207static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, 207static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
208 mode_t mode, struct proc_dir_entry *parent) { return NULL; } 208 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
209 209
210static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 210static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
211 mode_t mode, struct proc_dir_entry *base, 211 umode_t mode, struct proc_dir_entry *base,
212 read_proc_t *read_proc, void * data) { return NULL; } 212 read_proc_t *read_proc, void * data) { return NULL; }
213 213
214struct tty_driver; 214struct tty_driver;
diff --git a/include/sound/info.h b/include/sound/info.h
index 5492cc40dc57..9ca1a493d370 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -72,7 +72,7 @@ struct snd_info_entry_ops {
72 72
73struct snd_info_entry { 73struct snd_info_entry {
74 const char *name; 74 const char *name;
75 mode_t mode; 75 umode_t mode;
76 long size; 76 long size;
77 unsigned short content; 77 unsigned short content;
78 union { 78 union {