10
10
* See ./Documentation/core-api/kernel-api.rst for more details.
11
11
*/
12
12
13
- #define pr_fmt (fmt ) "debugfs: " fmt
13
+ #define pr_fmt (fmt ) "debugfs: " fmt
14
14
15
15
#include <linux/module.h>
16
16
#include <linux/fs.h>
30
30
31
31
#include "internal.h"
32
32
33
- #define DEBUGFS_DEFAULT_MODE 0700
33
+ #define DEBUGFS_DEFAULT_MODE 0700
34
34
35
35
static struct vfsmount * debugfs_mount ;
36
36
static int debugfs_mount_count ;
@@ -56,24 +56,24 @@ static int debugfs_setattr(struct user_namespace *mnt_userns,
56
56
}
57
57
58
58
static const struct inode_operations debugfs_file_inode_operations = {
59
- .setattr = debugfs_setattr ,
59
+ .setattr = debugfs_setattr ,
60
60
};
61
61
static const struct inode_operations debugfs_dir_inode_operations = {
62
- .lookup = simple_lookup ,
63
- .setattr = debugfs_setattr ,
62
+ .lookup = simple_lookup ,
63
+ .setattr = debugfs_setattr ,
64
64
};
65
65
static const struct inode_operations debugfs_symlink_inode_operations = {
66
- .get_link = simple_get_link ,
67
- .setattr = debugfs_setattr ,
66
+ .get_link = simple_get_link ,
67
+ .setattr = debugfs_setattr ,
68
68
};
69
69
70
70
static struct inode * debugfs_get_inode (struct super_block * sb )
71
71
{
72
72
struct inode * inode = new_inode (sb );
73
73
if (inode ) {
74
74
inode -> i_ino = get_next_ino ();
75
- inode -> i_atime = inode -> i_mtime =
76
- inode -> i_ctime = current_time (inode );
75
+ inode -> i_atime = inode -> i_mtime = inode -> i_ctime =
76
+ current_time (inode );
77
77
}
78
78
return inode ;
79
79
}
@@ -84,19 +84,12 @@ struct debugfs_mount_opts {
84
84
umode_t mode ;
85
85
};
86
86
87
- enum {
88
- Opt_uid ,
89
- Opt_gid ,
90
- Opt_mode ,
91
- Opt_err
92
- };
87
+ enum { Opt_uid , Opt_gid , Opt_mode , Opt_err };
93
88
94
- static const match_table_t tokens = {
95
- {Opt_uid , "uid=%u" },
96
- {Opt_gid , "gid=%u" },
97
- {Opt_mode , "mode=%o" },
98
- {Opt_err , NULL }
99
- };
89
+ static const match_table_t tokens = { { Opt_uid , "uid=%u" },
90
+ { Opt_gid , "gid=%u" },
91
+ { Opt_mode , "mode=%o" },
92
+ { Opt_err , NULL } };
100
93
101
94
struct debugfs_fs_info {
102
95
struct debugfs_mount_opts mount_opts ;
@@ -140,7 +133,7 @@ static int debugfs_parse_options(char *data, struct debugfs_mount_opts *opts)
140
133
return - EINVAL ;
141
134
opts -> mode = option & S_IALLUGO ;
142
135
break ;
143
- /*
136
+ /*
144
137
* We might like to report bad mount options here;
145
138
* but traditionally debugfs has ignored all mount options
146
139
*/
@@ -206,10 +199,10 @@ static void debugfs_free_inode(struct inode *inode)
206
199
}
207
200
208
201
static const struct super_operations debugfs_super_operations = {
209
- .statfs = simple_statfs ,
210
- .remount_fs = debugfs_remount ,
211
- .show_options = debugfs_show_options ,
212
- .free_inode = debugfs_free_inode ,
202
+ .statfs = simple_statfs ,
203
+ .remount_fs = debugfs_remount ,
204
+ .show_options = debugfs_show_options ,
205
+ .free_inode = debugfs_free_inode ,
213
206
};
214
207
215
208
static void debugfs_release_dentry (struct dentry * dentry )
@@ -235,7 +228,7 @@ static const struct dentry_operations debugfs_dops = {
235
228
236
229
static int debug_fill_super (struct super_block * sb , void * data , int silent )
237
230
{
238
- static const struct tree_descr debug_files [] = {{ "" } };
231
+ static const struct tree_descr debug_files [] = { { "" } };
239
232
struct debugfs_fs_info * fsi ;
240
233
int err ;
241
234
@@ -250,7 +243,7 @@ static int debug_fill_super(struct super_block *sb, void *data, int silent)
250
243
if (err )
251
244
goto fail ;
252
245
253
- err = simple_fill_super (sb , DEBUGFS_MAGIC , debug_files );
246
+ err = simple_fill_super (sb , DEBUGFS_MAGIC , debug_files );
254
247
if (err )
255
248
goto fail ;
256
249
@@ -267,9 +260,8 @@ static int debug_fill_super(struct super_block *sb, void *data, int silent)
267
260
return err ;
268
261
}
269
262
270
- static struct dentry * debug_mount (struct file_system_type * fs_type ,
271
- int flags , const char * dev_name ,
272
- void * data )
263
+ static struct dentry * debug_mount (struct file_system_type * fs_type , int flags ,
264
+ const char * dev_name , void * data )
273
265
{
274
266
if (!(debugfs_allow & DEBUGFS_ALLOW_API ))
275
267
return ERR_PTR (- EPERM );
@@ -278,10 +270,10 @@ static struct dentry *debug_mount(struct file_system_type *fs_type,
278
270
}
279
271
280
272
static struct file_system_type debug_fs_type = {
281
- .owner = THIS_MODULE ,
282
- .name = "debugfs" ,
283
- .mount = debug_mount ,
284
- .kill_sb = kill_litter_super ,
273
+ .owner = THIS_MODULE ,
274
+ .name = "debugfs" ,
275
+ .mount = debug_mount ,
276
+ .kill_sb = kill_litter_super ,
285
277
};
286
278
MODULE_ALIAS_FS ("debugfs" );
287
279
@@ -383,10 +375,10 @@ static struct dentry *end_creating(struct dentry *dentry)
383
375
return dentry ;
384
376
}
385
377
386
- static struct dentry * __debugfs_create_file ( const char * name , umode_t mode ,
387
- struct dentry * parent , void * data ,
388
- const struct file_operations * proxy_fops ,
389
- const struct file_operations * real_fops )
378
+ static struct dentry *
379
+ __debugfs_create_file ( const char * name , umode_t mode , struct dentry * parent ,
380
+ void * data , const struct file_operations * proxy_fops ,
381
+ const struct file_operations * real_fops )
390
382
{
391
383
struct dentry * dentry ;
392
384
struct inode * inode ;
@@ -417,7 +409,7 @@ static struct dentry *__debugfs_create_file(const char *name, umode_t mode,
417
409
inode -> i_op = & debugfs_file_inode_operations ;
418
410
inode -> i_fop = proxy_fops ;
419
411
dentry -> d_fsdata = (void * )((unsigned long )real_fops |
420
- DEBUGFS_FSDATA_IS_REAL_FOPS_BIT );
412
+ DEBUGFS_FSDATA_IS_REAL_FOPS_BIT );
421
413
422
414
d_instantiate (dentry , inode );
423
415
fsnotify_create (d_inode (dentry -> d_parent ), dentry );
@@ -455,11 +447,11 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode,
455
447
struct dentry * parent , void * data ,
456
448
const struct file_operations * fops )
457
449
{
458
-
459
- return __debugfs_create_file ( name , mode , parent , data ,
460
- fops ? & debugfs_full_proxy_file_operations :
461
- & debugfs_noop_file_operations ,
462
- fops );
450
+ return __debugfs_create_file (
451
+ name , mode , parent , data ,
452
+ fops ? & debugfs_full_proxy_file_operations :
453
+ & debugfs_noop_file_operations ,
454
+ fops );
463
455
}
464
456
EXPORT_SYMBOL_GPL (debugfs_create_file );
465
457
@@ -491,14 +483,14 @@ EXPORT_SYMBOL_GPL(debugfs_create_file);
491
483
* thus, may be used here.
492
484
*/
493
485
struct dentry * debugfs_create_file_unsafe (const char * name , umode_t mode ,
494
- struct dentry * parent , void * data ,
495
- const struct file_operations * fops )
486
+ struct dentry * parent , void * data ,
487
+ const struct file_operations * fops )
496
488
{
497
-
498
- return __debugfs_create_file ( name , mode , parent , data ,
499
- fops ? & debugfs_open_proxy_file_operations :
500
- & debugfs_noop_file_operations ,
501
- fops );
489
+ return __debugfs_create_file (
490
+ name , mode , parent , data ,
491
+ fops ? & debugfs_open_proxy_file_operations :
492
+ & debugfs_noop_file_operations ,
493
+ fops );
502
494
}
503
495
EXPORT_SYMBOL_GPL (debugfs_create_file_unsafe );
504
496
@@ -596,10 +588,8 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
596
588
*
597
589
* @f should return what ->d_automount() would.
598
590
*/
599
- struct dentry * debugfs_create_automount (const char * name ,
600
- struct dentry * parent ,
601
- debugfs_automount_t f ,
602
- void * data )
591
+ struct dentry * debugfs_create_automount (const char * name , struct dentry * parent ,
592
+ debugfs_automount_t f , void * data )
603
593
{
604
594
struct dentry * dentry = start_creating (name , parent );
605
595
struct inode * inode ;
@@ -705,7 +695,7 @@ static void __debugfs_file_removed(struct dentry *dentry)
705
695
706
696
static void remove_one (struct dentry * victim )
707
697
{
708
- if (d_is_reg (victim ))
698
+ if (d_is_reg (victim ))
709
699
__debugfs_file_removed (victim );
710
700
simple_release_fs (& debugfs_mount , & debugfs_mount_count );
711
701
}
@@ -754,7 +744,7 @@ EXPORT_SYMBOL_GPL(debugfs_remove);
754
744
* returned.
755
745
*/
756
746
struct dentry * debugfs_rename (struct dentry * old_dir , struct dentry * old_dentry ,
757
- struct dentry * new_dir , const char * new_name )
747
+ struct dentry * new_dir , const char * new_name )
758
748
{
759
749
int error ;
760
750
struct dentry * dentry = NULL , * trap ;
@@ -790,8 +780,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
790
780
}
791
781
d_move (old_dentry , dentry );
792
782
fsnotify_move (d_inode (old_dir ), d_inode (new_dir ), & old_name .name ,
793
- d_is_dir (old_dentry ),
794
- NULL , old_dentry );
783
+ d_is_dir (old_dentry ), NULL , old_dentry );
795
784
release_dentry_name_snapshot (& old_name );
796
785
unlock_rename (new_dir , old_dir );
797
786
dput (dentry );
0 commit comments