Skip to content

Commit f4ae40a

Browse files
author
Al Viro
committed
switch debugfs to umode_t
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 48176a9 commit f4ae40a

File tree

25 files changed

+82
-82
lines changed

25 files changed

+82
-82
lines changed

Documentation/filesystems/debugfs.txt

+12-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ described below will work.
3535

3636
The most general way to create a file within a debugfs directory is with:
3737

38-
struct dentry *debugfs_create_file(const char *name, mode_t mode,
38+
struct dentry *debugfs_create_file(const char *name, umode_t mode,
3939
struct dentry *parent, void *data,
4040
const struct file_operations *fops);
4141

@@ -53,35 +53,35 @@ actually necessary; the debugfs code provides a number of helper functions
5353
for simple situations. Files containing a single integer value can be
5454
created with any of:
5555

56-
struct dentry *debugfs_create_u8(const char *name, mode_t mode,
56+
struct dentry *debugfs_create_u8(const char *name, umode_t mode,
5757
struct dentry *parent, u8 *value);
58-
struct dentry *debugfs_create_u16(const char *name, mode_t mode,
58+
struct dentry *debugfs_create_u16(const char *name, umode_t mode,
5959
struct dentry *parent, u16 *value);
60-
struct dentry *debugfs_create_u32(const char *name, mode_t mode,
60+
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
6161
struct dentry *parent, u32 *value);
62-
struct dentry *debugfs_create_u64(const char *name, mode_t mode,
62+
struct dentry *debugfs_create_u64(const char *name, umode_t mode,
6363
struct dentry *parent, u64 *value);
6464

6565
These files support both reading and writing the given value; if a specific
6666
file should not be written to, simply set the mode bits accordingly. The
6767
values in these files are in decimal; if hexadecimal is more appropriate,
6868
the following functions can be used instead:
6969

70-
struct dentry *debugfs_create_x8(const char *name, mode_t mode,
70+
struct dentry *debugfs_create_x8(const char *name, umode_t mode,
7171
struct dentry *parent, u8 *value);
72-
struct dentry *debugfs_create_x16(const char *name, mode_t mode,
72+
struct dentry *debugfs_create_x16(const char *name, umode_t mode,
7373
struct dentry *parent, u16 *value);
74-
struct dentry *debugfs_create_x32(const char *name, mode_t mode,
74+
struct dentry *debugfs_create_x32(const char *name, umode_t mode,
7575
struct dentry *parent, u32 *value);
76-
struct dentry *debugfs_create_x64(const char *name, mode_t mode,
76+
struct dentry *debugfs_create_x64(const char *name, umode_t mode,
7777
struct dentry *parent, u64 *value);
7878

7979
These functions are useful as long as the developer knows the size of the
8080
value to be exported. Some types can have different widths on different
8181
architectures, though, complicating the situation somewhat. There is a
8282
function meant to help out in one special case:
8383

84-
struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
84+
struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
8585
struct dentry *parent,
8686
size_t *value);
8787

@@ -90,7 +90,7 @@ a variable of type size_t.
9090

9191
Boolean values can be placed in debugfs with:
9292

93-
struct dentry *debugfs_create_bool(const char *name, mode_t mode,
93+
struct dentry *debugfs_create_bool(const char *name, umode_t mode,
9494
struct dentry *parent, u32 *value);
9595

9696
A read on the resulting file will yield either Y (for non-zero values) or
@@ -104,7 +104,7 @@ Finally, a block of arbitrary binary data can be exported with:
104104
unsigned long size;
105105
};
106106

107-
struct dentry *debugfs_create_blob(const char *name, mode_t mode,
107+
struct dentry *debugfs_create_blob(const char *name, umode_t mode,
108108
struct dentry *parent,
109109
struct debugfs_blob_wrapper *blob);
110110

arch/arm/mach-msm/smd_debug.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static const struct file_operations debug_ops = {
215215
.llseek = default_llseek,
216216
};
217217

218-
static void debug_create(const char *name, mode_t mode,
218+
static void debug_create(const char *name, umode_t mode,
219219
struct dentry *dent,
220220
int (*fill)(char *buf, int max))
221221
{

arch/s390/include/asm/debug.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typedef struct debug_info {
7373
struct dentry* debugfs_entries[DEBUG_MAX_VIEWS];
7474
struct debug_view* views[DEBUG_MAX_VIEWS];
7575
char name[DEBUG_MAX_NAME_LEN];
76-
mode_t mode;
76+
umode_t mode;
7777
} debug_info_t;
7878

7979
typedef int (debug_header_proc_t) (debug_info_t* id,
@@ -124,7 +124,7 @@ debug_info_t *debug_register(const char *name, int pages, int nr_areas,
124124
int buf_size);
125125

126126
debug_info_t *debug_register_mode(const char *name, int pages, int nr_areas,
127-
int buf_size, mode_t mode, uid_t uid,
127+
int buf_size, umode_t mode, uid_t uid,
128128
gid_t gid);
129129

130130
void debug_unregister(debug_info_t* id);

arch/s390/kernel/debug.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static ssize_t debug_input(struct file *file, const char __user *user_buf,
7474
static int debug_open(struct inode *inode, struct file *file);
7575
static int debug_close(struct inode *inode, struct file *file);
7676
static debug_info_t *debug_info_create(const char *name, int pages_per_area,
77-
int nr_areas, int buf_size, mode_t mode);
77+
int nr_areas, int buf_size, umode_t mode);
7878
static void debug_info_get(debug_info_t *);
7979
static void debug_info_put(debug_info_t *);
8080
static int debug_prolog_level_fn(debug_info_t * id,
@@ -330,7 +330,7 @@ debug_info_free(debug_info_t* db_info){
330330

331331
static debug_info_t*
332332
debug_info_create(const char *name, int pages_per_area, int nr_areas,
333-
int buf_size, mode_t mode)
333+
int buf_size, umode_t mode)
334334
{
335335
debug_info_t* rc;
336336

@@ -688,7 +688,7 @@ debug_close(struct inode *inode, struct file *file)
688688
*/
689689

690690
debug_info_t *debug_register_mode(const char *name, int pages_per_area,
691-
int nr_areas, int buf_size, mode_t mode,
691+
int nr_areas, int buf_size, umode_t mode,
692692
uid_t uid, gid_t gid)
693693
{
694694
debug_info_t *rc = NULL;
@@ -1090,7 +1090,7 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
10901090
int rc = 0;
10911091
int i;
10921092
unsigned long flags;
1093-
mode_t mode;
1093+
umode_t mode;
10941094
struct dentry *pde;
10951095

10961096
if (!id)

arch/x86/xen/debugfs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static const struct file_operations u32_array_fops = {
109109
.llseek = no_llseek,
110110
};
111111

112-
struct dentry *xen_debugfs_create_u32_array(const char *name, mode_t mode,
112+
struct dentry *xen_debugfs_create_u32_array(const char *name, umode_t mode,
113113
struct dentry *parent,
114114
u32 *array, unsigned elements)
115115
{

arch/x86/xen/debugfs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
struct dentry * __init xen_init_debugfs(void);
55

6-
struct dentry *xen_debugfs_create_u32_array(const char *name, mode_t mode,
6+
struct dentry *xen_debugfs_create_u32_array(const char *name, umode_t mode,
77
struct dentry *parent,
88
u32 *array, unsigned elements);
99

drivers/acpi/ec_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
105105
{
106106
struct dentry *dev_dir;
107107
char name[64];
108-
mode_t mode = 0400;
108+
umode_t mode = 0400;
109109

110110
if (ec_device_count == 0) {
111111
acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);

drivers/mmc/card/mmc_test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2949,7 +2949,7 @@ static void mmc_test_free_dbgfs_file(struct mmc_card *card)
29492949
}
29502950

29512951
static int __mmc_test_register_dbgfs_file(struct mmc_card *card,
2952-
const char *name, mode_t mode, const struct file_operations *fops)
2952+
const char *name, umode_t mode, const struct file_operations *fops)
29532953
{
29542954
struct dentry *file = NULL;
29552955
struct mmc_test_dbgfs_file *df;

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ static const struct file_operations interfaces_proc_fops = {
20002000
*/
20012001
struct cxgb4vf_debugfs_entry {
20022002
const char *name; /* name of debugfs node */
2003-
mode_t mode; /* file system mode */
2003+
umode_t mode; /* file system mode */
20042004
const struct file_operations *fops;
20052005
};
20062006

drivers/net/wireless/ath/carl9170/debug.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int carl9170_debugfs_open(struct inode *inode, struct file *file)
5656

5757
struct carl9170_debugfs_fops {
5858
unsigned int read_bufsize;
59-
mode_t attr;
59+
umode_t attr;
6060
char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize,
6161
ssize_t *len);
6262
ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size);

drivers/net/wireless/libertas/debugfs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static ssize_t lbs_wrrf_write(struct file *file,
704704

705705
struct lbs_debugfs_files {
706706
const char *name;
707-
int perm;
707+
umode_t perm;
708708
struct file_operations fops;
709709
};
710710

drivers/s390/block/dasd.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ static const struct file_operations dasd_stats_global_fops = {
10731073
static void dasd_profile_init(struct dasd_profile *profile,
10741074
struct dentry *base_dentry)
10751075
{
1076-
mode_t mode;
1076+
umode_t mode;
10771077
struct dentry *pde;
10781078

10791079
if (!base_dentry)
@@ -1112,7 +1112,7 @@ static void dasd_statistics_removeroot(void)
11121112

11131113
static void dasd_statistics_createroot(void)
11141114
{
1115-
mode_t mode;
1115+
umode_t mode;
11161116
struct dentry *pde;
11171117

11181118
dasd_debugfs_root_entry = NULL;

drivers/scsi/bfa/bfad_debugfs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static const struct file_operations bfad_debugfs_op_regwr = {
472472

473473
struct bfad_debugfs_entry {
474474
const char *name;
475-
mode_t mode;
475+
umode_t mode;
476476
const struct file_operations *fops;
477477
};
478478

fs/debugfs/file.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_u8_wo, NULL, debugfs_u8_set, "%llu\n");
9595
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
9696
* code.
9797
*/
98-
struct dentry *debugfs_create_u8(const char *name, mode_t mode,
98+
struct dentry *debugfs_create_u8(const char *name, umode_t mode,
9999
struct dentry *parent, u8 *value)
100100
{
101101
/* if there are no write bits set, make read only */
@@ -147,7 +147,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_u16_wo, NULL, debugfs_u16_set, "%llu\n");
147147
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
148148
* code.
149149
*/
150-
struct dentry *debugfs_create_u16(const char *name, mode_t mode,
150+
struct dentry *debugfs_create_u16(const char *name, umode_t mode,
151151
struct dentry *parent, u16 *value)
152152
{
153153
/* if there are no write bits set, make read only */
@@ -199,7 +199,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_u32_wo, NULL, debugfs_u32_set, "%llu\n");
199199
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
200200
* code.
201201
*/
202-
struct dentry *debugfs_create_u32(const char *name, mode_t mode,
202+
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
203203
struct dentry *parent, u32 *value)
204204
{
205205
/* if there are no write bits set, make read only */
@@ -252,7 +252,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_u64_wo, NULL, debugfs_u64_set, "%llu\n");
252252
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
253253
* code.
254254
*/
255-
struct dentry *debugfs_create_u64(const char *name, mode_t mode,
255+
struct dentry *debugfs_create_u64(const char *name, umode_t mode,
256256
struct dentry *parent, u64 *value)
257257
{
258258
/* if there are no write bits set, make read only */
@@ -298,7 +298,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_x64, debugfs_u64_get, debugfs_u64_set, "0x%016llx\n
298298
* @value: a pointer to the variable that the file should read to and write
299299
* from.
300300
*/
301-
struct dentry *debugfs_create_x8(const char *name, mode_t mode,
301+
struct dentry *debugfs_create_x8(const char *name, umode_t mode,
302302
struct dentry *parent, u8 *value)
303303
{
304304
/* if there are no write bits set, make read only */
@@ -322,7 +322,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_x8);
322322
* @value: a pointer to the variable that the file should read to and write
323323
* from.
324324
*/
325-
struct dentry *debugfs_create_x16(const char *name, mode_t mode,
325+
struct dentry *debugfs_create_x16(const char *name, umode_t mode,
326326
struct dentry *parent, u16 *value)
327327
{
328328
/* if there are no write bits set, make read only */
@@ -346,7 +346,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_x16);
346346
* @value: a pointer to the variable that the file should read to and write
347347
* from.
348348
*/
349-
struct dentry *debugfs_create_x32(const char *name, mode_t mode,
349+
struct dentry *debugfs_create_x32(const char *name, umode_t mode,
350350
struct dentry *parent, u32 *value)
351351
{
352352
/* if there are no write bits set, make read only */
@@ -370,7 +370,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_x32);
370370
* @value: a pointer to the variable that the file should read to and write
371371
* from.
372372
*/
373-
struct dentry *debugfs_create_x64(const char *name, mode_t mode,
373+
struct dentry *debugfs_create_x64(const char *name, umode_t mode,
374374
struct dentry *parent, u64 *value)
375375
{
376376
return debugfs_create_file(name, mode, parent, value, &fops_x64);
@@ -401,7 +401,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_size_t, debugfs_size_t_get, debugfs_size_t_set,
401401
* @value: a pointer to the variable that the file should read to and write
402402
* from.
403403
*/
404-
struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
404+
struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
405405
struct dentry *parent, size_t *value)
406406
{
407407
return debugfs_create_file(name, mode, parent, value, &fops_size_t);
@@ -473,7 +473,7 @@ static const struct file_operations fops_bool = {
473473
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
474474
* code.
475475
*/
476-
struct dentry *debugfs_create_bool(const char *name, mode_t mode,
476+
struct dentry *debugfs_create_bool(const char *name, umode_t mode,
477477
struct dentry *parent, u32 *value)
478478
{
479479
return debugfs_create_file(name, mode, parent, value, &fops_bool);
@@ -518,7 +518,7 @@ static const struct file_operations fops_blob = {
518518
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
519519
* code.
520520
*/
521-
struct dentry *debugfs_create_blob(const char *name, mode_t mode,
521+
struct dentry *debugfs_create_blob(const char *name, umode_t mode,
522522
struct dentry *parent,
523523
struct debugfs_blob_wrapper *blob)
524524
{

fs/debugfs/inode.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static struct vfsmount *debugfs_mount;
3030
static int debugfs_mount_count;
3131
static bool debugfs_registered;
3232

33-
static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t dev,
33+
static struct inode *debugfs_get_inode(struct super_block *sb, umode_t mode, dev_t dev,
3434
void *data, const struct file_operations *fops)
3535

3636
{
@@ -69,7 +69,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t d
6969

7070
/* SMP-safe */
7171
static int debugfs_mknod(struct inode *dir, struct dentry *dentry,
72-
int mode, dev_t dev, void *data,
72+
umode_t mode, dev_t dev, void *data,
7373
const struct file_operations *fops)
7474
{
7575
struct inode *inode;
@@ -87,7 +87,7 @@ static int debugfs_mknod(struct inode *dir, struct dentry *dentry,
8787
return error;
8888
}
8989

90-
static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, int mode,
90+
static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode,
9191
void *data, const struct file_operations *fops)
9292
{
9393
int res;
@@ -101,14 +101,14 @@ static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, int mode,
101101
return res;
102102
}
103103

104-
static int debugfs_link(struct inode *dir, struct dentry *dentry, int mode,
104+
static int debugfs_link(struct inode *dir, struct dentry *dentry, umode_t mode,
105105
void *data, const struct file_operations *fops)
106106
{
107107
mode = (mode & S_IALLUGO) | S_IFLNK;
108108
return debugfs_mknod(dir, dentry, mode, 0, data, fops);
109109
}
110110

111-
static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode,
111+
static int debugfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
112112
void *data, const struct file_operations *fops)
113113
{
114114
int res;
@@ -146,7 +146,7 @@ static struct file_system_type debug_fs_type = {
146146
.kill_sb = kill_litter_super,
147147
};
148148

149-
static int debugfs_create_by_name(const char *name, mode_t mode,
149+
static int debugfs_create_by_name(const char *name, umode_t mode,
150150
struct dentry *parent,
151151
struct dentry **dentry,
152152
void *data,
@@ -214,7 +214,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
214214
* If debugfs is not enabled in the kernel, the value -%ENODEV will be
215215
* returned.
216216
*/
217-
struct dentry *debugfs_create_file(const char *name, mode_t mode,
217+
struct dentry *debugfs_create_file(const char *name, umode_t mode,
218218
struct dentry *parent, void *data,
219219
const struct file_operations *fops)
220220
{

fs/ocfs2/cluster/netdebug.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ void o2net_debugfs_exit(void)
553553

554554
int o2net_debugfs_init(void)
555555
{
556-
mode_t mode = S_IFREG|S_IRUSR;
556+
umode_t mode = S_IFREG|S_IRUSR;
557557

558558
o2net_dentry = debugfs_create_dir(O2NET_DEBUG_DIR, NULL);
559559
if (o2net_dentry)

0 commit comments

Comments
 (0)