0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #define pr_fmt(fmt) "debugfs: " fmt
0014
0015 #include <linux/module.h>
0016 #include <linux/fs.h>
0017 #include <linux/mount.h>
0018 #include <linux/pagemap.h>
0019 #include <linux/init.h>
0020 #include <linux/kobject.h>
0021 #include <linux/namei.h>
0022 #include <linux/debugfs.h>
0023 #include <linux/fsnotify.h>
0024 #include <linux/string.h>
0025 #include <linux/seq_file.h>
0026 #include <linux/parser.h>
0027 #include <linux/magic.h>
0028 #include <linux/slab.h>
0029 #include <linux/security.h>
0030
0031 #include "internal.h"
0032
0033 #define DEBUGFS_DEFAULT_MODE 0700
0034
0035 static struct vfsmount *debugfs_mount;
0036 static int debugfs_mount_count;
0037 static bool debugfs_registered;
0038 static unsigned int debugfs_allow __ro_after_init = DEFAULT_DEBUGFS_ALLOW_BITS;
0039
0040
0041
0042
0043
0044
0045 static int debugfs_setattr(struct user_namespace *mnt_userns,
0046 struct dentry *dentry, struct iattr *ia)
0047 {
0048 int ret;
0049
0050 if (ia->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) {
0051 ret = security_locked_down(LOCKDOWN_DEBUGFS);
0052 if (ret)
0053 return ret;
0054 }
0055 return simple_setattr(&init_user_ns, dentry, ia);
0056 }
0057
0058 static const struct inode_operations debugfs_file_inode_operations = {
0059 .setattr = debugfs_setattr,
0060 };
0061 static const struct inode_operations debugfs_dir_inode_operations = {
0062 .lookup = simple_lookup,
0063 .setattr = debugfs_setattr,
0064 };
0065 static const struct inode_operations debugfs_symlink_inode_operations = {
0066 .get_link = simple_get_link,
0067 .setattr = debugfs_setattr,
0068 };
0069
0070 static struct inode *debugfs_get_inode(struct super_block *sb)
0071 {
0072 struct inode *inode = new_inode(sb);
0073 if (inode) {
0074 inode->i_ino = get_next_ino();
0075 inode->i_atime = inode->i_mtime =
0076 inode->i_ctime = current_time(inode);
0077 }
0078 return inode;
0079 }
0080
0081 struct debugfs_mount_opts {
0082 kuid_t uid;
0083 kgid_t gid;
0084 umode_t mode;
0085 };
0086
0087 enum {
0088 Opt_uid,
0089 Opt_gid,
0090 Opt_mode,
0091 Opt_err
0092 };
0093
0094 static const match_table_t tokens = {
0095 {Opt_uid, "uid=%u"},
0096 {Opt_gid, "gid=%u"},
0097 {Opt_mode, "mode=%o"},
0098 {Opt_err, NULL}
0099 };
0100
0101 struct debugfs_fs_info {
0102 struct debugfs_mount_opts mount_opts;
0103 };
0104
0105 static int debugfs_parse_options(char *data, struct debugfs_mount_opts *opts)
0106 {
0107 substring_t args[MAX_OPT_ARGS];
0108 int option;
0109 int token;
0110 kuid_t uid;
0111 kgid_t gid;
0112 char *p;
0113
0114 opts->mode = DEBUGFS_DEFAULT_MODE;
0115
0116 while ((p = strsep(&data, ",")) != NULL) {
0117 if (!*p)
0118 continue;
0119
0120 token = match_token(p, tokens, args);
0121 switch (token) {
0122 case Opt_uid:
0123 if (match_int(&args[0], &option))
0124 return -EINVAL;
0125 uid = make_kuid(current_user_ns(), option);
0126 if (!uid_valid(uid))
0127 return -EINVAL;
0128 opts->uid = uid;
0129 break;
0130 case Opt_gid:
0131 if (match_int(&args[0], &option))
0132 return -EINVAL;
0133 gid = make_kgid(current_user_ns(), option);
0134 if (!gid_valid(gid))
0135 return -EINVAL;
0136 opts->gid = gid;
0137 break;
0138 case Opt_mode:
0139 if (match_octal(&args[0], &option))
0140 return -EINVAL;
0141 opts->mode = option & S_IALLUGO;
0142 break;
0143
0144
0145
0146
0147 }
0148 }
0149
0150 return 0;
0151 }
0152
0153 static int debugfs_apply_options(struct super_block *sb)
0154 {
0155 struct debugfs_fs_info *fsi = sb->s_fs_info;
0156 struct inode *inode = d_inode(sb->s_root);
0157 struct debugfs_mount_opts *opts = &fsi->mount_opts;
0158
0159 inode->i_mode &= ~S_IALLUGO;
0160 inode->i_mode |= opts->mode;
0161
0162 inode->i_uid = opts->uid;
0163 inode->i_gid = opts->gid;
0164
0165 return 0;
0166 }
0167
0168 static int debugfs_remount(struct super_block *sb, int *flags, char *data)
0169 {
0170 int err;
0171 struct debugfs_fs_info *fsi = sb->s_fs_info;
0172
0173 sync_filesystem(sb);
0174 err = debugfs_parse_options(data, &fsi->mount_opts);
0175 if (err)
0176 goto fail;
0177
0178 debugfs_apply_options(sb);
0179
0180 fail:
0181 return err;
0182 }
0183
0184 static int debugfs_show_options(struct seq_file *m, struct dentry *root)
0185 {
0186 struct debugfs_fs_info *fsi = root->d_sb->s_fs_info;
0187 struct debugfs_mount_opts *opts = &fsi->mount_opts;
0188
0189 if (!uid_eq(opts->uid, GLOBAL_ROOT_UID))
0190 seq_printf(m, ",uid=%u",
0191 from_kuid_munged(&init_user_ns, opts->uid));
0192 if (!gid_eq(opts->gid, GLOBAL_ROOT_GID))
0193 seq_printf(m, ",gid=%u",
0194 from_kgid_munged(&init_user_ns, opts->gid));
0195 if (opts->mode != DEBUGFS_DEFAULT_MODE)
0196 seq_printf(m, ",mode=%o", opts->mode);
0197
0198 return 0;
0199 }
0200
0201 static void debugfs_free_inode(struct inode *inode)
0202 {
0203 if (S_ISLNK(inode->i_mode))
0204 kfree(inode->i_link);
0205 free_inode_nonrcu(inode);
0206 }
0207
0208 static const struct super_operations debugfs_super_operations = {
0209 .statfs = simple_statfs,
0210 .remount_fs = debugfs_remount,
0211 .show_options = debugfs_show_options,
0212 .free_inode = debugfs_free_inode,
0213 };
0214
0215 static void debugfs_release_dentry(struct dentry *dentry)
0216 {
0217 void *fsd = dentry->d_fsdata;
0218
0219 if (!((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT))
0220 kfree(dentry->d_fsdata);
0221 }
0222
0223 static struct vfsmount *debugfs_automount(struct path *path)
0224 {
0225 debugfs_automount_t f;
0226 f = (debugfs_automount_t)path->dentry->d_fsdata;
0227 return f(path->dentry, d_inode(path->dentry)->i_private);
0228 }
0229
0230 static const struct dentry_operations debugfs_dops = {
0231 .d_delete = always_delete_dentry,
0232 .d_release = debugfs_release_dentry,
0233 .d_automount = debugfs_automount,
0234 };
0235
0236 static int debug_fill_super(struct super_block *sb, void *data, int silent)
0237 {
0238 static const struct tree_descr debug_files[] = {{""}};
0239 struct debugfs_fs_info *fsi;
0240 int err;
0241
0242 fsi = kzalloc(sizeof(struct debugfs_fs_info), GFP_KERNEL);
0243 sb->s_fs_info = fsi;
0244 if (!fsi) {
0245 err = -ENOMEM;
0246 goto fail;
0247 }
0248
0249 err = debugfs_parse_options(data, &fsi->mount_opts);
0250 if (err)
0251 goto fail;
0252
0253 err = simple_fill_super(sb, DEBUGFS_MAGIC, debug_files);
0254 if (err)
0255 goto fail;
0256
0257 sb->s_op = &debugfs_super_operations;
0258 sb->s_d_op = &debugfs_dops;
0259
0260 debugfs_apply_options(sb);
0261
0262 return 0;
0263
0264 fail:
0265 kfree(fsi);
0266 sb->s_fs_info = NULL;
0267 return err;
0268 }
0269
0270 static struct dentry *debug_mount(struct file_system_type *fs_type,
0271 int flags, const char *dev_name,
0272 void *data)
0273 {
0274 if (!(debugfs_allow & DEBUGFS_ALLOW_API))
0275 return ERR_PTR(-EPERM);
0276
0277 return mount_single(fs_type, flags, data, debug_fill_super);
0278 }
0279
0280 static struct file_system_type debug_fs_type = {
0281 .owner = THIS_MODULE,
0282 .name = "debugfs",
0283 .mount = debug_mount,
0284 .kill_sb = kill_litter_super,
0285 };
0286 MODULE_ALIAS_FS("debugfs");
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300 struct dentry *debugfs_lookup(const char *name, struct dentry *parent)
0301 {
0302 struct dentry *dentry;
0303
0304 if (!debugfs_initialized() || IS_ERR_OR_NULL(name) || IS_ERR(parent))
0305 return NULL;
0306
0307 if (!parent)
0308 parent = debugfs_mount->mnt_root;
0309
0310 dentry = lookup_positive_unlocked(name, parent, strlen(name));
0311 if (IS_ERR(dentry))
0312 return NULL;
0313 return dentry;
0314 }
0315 EXPORT_SYMBOL_GPL(debugfs_lookup);
0316
0317 static struct dentry *start_creating(const char *name, struct dentry *parent)
0318 {
0319 struct dentry *dentry;
0320 int error;
0321
0322 if (!(debugfs_allow & DEBUGFS_ALLOW_API))
0323 return ERR_PTR(-EPERM);
0324
0325 if (!debugfs_initialized())
0326 return ERR_PTR(-ENOENT);
0327
0328 pr_debug("creating file '%s'\n", name);
0329
0330 if (IS_ERR(parent))
0331 return parent;
0332
0333 error = simple_pin_fs(&debug_fs_type, &debugfs_mount,
0334 &debugfs_mount_count);
0335 if (error) {
0336 pr_err("Unable to pin filesystem for file '%s'\n", name);
0337 return ERR_PTR(error);
0338 }
0339
0340
0341
0342
0343
0344
0345 if (!parent)
0346 parent = debugfs_mount->mnt_root;
0347
0348 inode_lock(d_inode(parent));
0349 if (unlikely(IS_DEADDIR(d_inode(parent))))
0350 dentry = ERR_PTR(-ENOENT);
0351 else
0352 dentry = lookup_one_len(name, parent, strlen(name));
0353 if (!IS_ERR(dentry) && d_really_is_positive(dentry)) {
0354 if (d_is_dir(dentry))
0355 pr_err("Directory '%s' with parent '%s' already present!\n",
0356 name, parent->d_name.name);
0357 else
0358 pr_err("File '%s' in directory '%s' already present!\n",
0359 name, parent->d_name.name);
0360 dput(dentry);
0361 dentry = ERR_PTR(-EEXIST);
0362 }
0363
0364 if (IS_ERR(dentry)) {
0365 inode_unlock(d_inode(parent));
0366 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
0367 }
0368
0369 return dentry;
0370 }
0371
0372 static struct dentry *failed_creating(struct dentry *dentry)
0373 {
0374 inode_unlock(d_inode(dentry->d_parent));
0375 dput(dentry);
0376 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
0377 return ERR_PTR(-ENOMEM);
0378 }
0379
0380 static struct dentry *end_creating(struct dentry *dentry)
0381 {
0382 inode_unlock(d_inode(dentry->d_parent));
0383 return dentry;
0384 }
0385
0386 static struct dentry *__debugfs_create_file(const char *name, umode_t mode,
0387 struct dentry *parent, void *data,
0388 const struct file_operations *proxy_fops,
0389 const struct file_operations *real_fops)
0390 {
0391 struct dentry *dentry;
0392 struct inode *inode;
0393
0394 if (!(mode & S_IFMT))
0395 mode |= S_IFREG;
0396 BUG_ON(!S_ISREG(mode));
0397 dentry = start_creating(name, parent);
0398
0399 if (IS_ERR(dentry))
0400 return dentry;
0401
0402 if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {
0403 failed_creating(dentry);
0404 return ERR_PTR(-EPERM);
0405 }
0406
0407 inode = debugfs_get_inode(dentry->d_sb);
0408 if (unlikely(!inode)) {
0409 pr_err("out of free dentries, can not create file '%s'\n",
0410 name);
0411 return failed_creating(dentry);
0412 }
0413
0414 inode->i_mode = mode;
0415 inode->i_private = data;
0416
0417 inode->i_op = &debugfs_file_inode_operations;
0418 inode->i_fop = proxy_fops;
0419 dentry->d_fsdata = (void *)((unsigned long)real_fops |
0420 DEBUGFS_FSDATA_IS_REAL_FOPS_BIT);
0421
0422 d_instantiate(dentry, inode);
0423 fsnotify_create(d_inode(dentry->d_parent), dentry);
0424 return end_creating(dentry);
0425 }
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454
0455
0456
0457
0458
0459 struct dentry *debugfs_create_file(const char *name, umode_t mode,
0460 struct dentry *parent, void *data,
0461 const struct file_operations *fops)
0462 {
0463
0464 return __debugfs_create_file(name, mode, parent, data,
0465 fops ? &debugfs_full_proxy_file_operations :
0466 &debugfs_noop_file_operations,
0467 fops);
0468 }
0469 EXPORT_SYMBOL_GPL(debugfs_create_file);
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498 struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
0499 struct dentry *parent, void *data,
0500 const struct file_operations *fops)
0501 {
0502
0503 return __debugfs_create_file(name, mode, parent, data,
0504 fops ? &debugfs_open_proxy_file_operations :
0505 &debugfs_noop_file_operations,
0506 fops);
0507 }
0508 EXPORT_SYMBOL_GPL(debugfs_create_file_unsafe);
0509
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519
0520
0521
0522
0523
0524
0525
0526
0527
0528
0529 void debugfs_create_file_size(const char *name, umode_t mode,
0530 struct dentry *parent, void *data,
0531 const struct file_operations *fops,
0532 loff_t file_size)
0533 {
0534 struct dentry *de = debugfs_create_file(name, mode, parent, data, fops);
0535
0536 if (!IS_ERR(de))
0537 d_inode(de)->i_size = file_size;
0538 }
0539 EXPORT_SYMBOL_GPL(debugfs_create_file_size);
0540
0541
0542
0543
0544
0545
0546
0547
0548
0549
0550
0551
0552
0553
0554
0555
0556
0557
0558
0559
0560
0561
0562
0563
0564
0565 struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
0566 {
0567 struct dentry *dentry = start_creating(name, parent);
0568 struct inode *inode;
0569
0570 if (IS_ERR(dentry))
0571 return dentry;
0572
0573 if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {
0574 failed_creating(dentry);
0575 return ERR_PTR(-EPERM);
0576 }
0577
0578 inode = debugfs_get_inode(dentry->d_sb);
0579 if (unlikely(!inode)) {
0580 pr_err("out of free dentries, can not create directory '%s'\n",
0581 name);
0582 return failed_creating(dentry);
0583 }
0584
0585 inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO;
0586 inode->i_op = &debugfs_dir_inode_operations;
0587 inode->i_fop = &simple_dir_operations;
0588
0589
0590 inc_nlink(inode);
0591 d_instantiate(dentry, inode);
0592 inc_nlink(d_inode(dentry->d_parent));
0593 fsnotify_mkdir(d_inode(dentry->d_parent), dentry);
0594 return end_creating(dentry);
0595 }
0596 EXPORT_SYMBOL_GPL(debugfs_create_dir);
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609 struct dentry *debugfs_create_automount(const char *name,
0610 struct dentry *parent,
0611 debugfs_automount_t f,
0612 void *data)
0613 {
0614 struct dentry *dentry = start_creating(name, parent);
0615 struct inode *inode;
0616
0617 if (IS_ERR(dentry))
0618 return dentry;
0619
0620 if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {
0621 failed_creating(dentry);
0622 return ERR_PTR(-EPERM);
0623 }
0624
0625 inode = debugfs_get_inode(dentry->d_sb);
0626 if (unlikely(!inode)) {
0627 pr_err("out of free dentries, can not create automount '%s'\n",
0628 name);
0629 return failed_creating(dentry);
0630 }
0631
0632 make_empty_dir_inode(inode);
0633 inode->i_flags |= S_AUTOMOUNT;
0634 inode->i_private = data;
0635 dentry->d_fsdata = (void *)f;
0636
0637 inc_nlink(inode);
0638 d_instantiate(dentry, inode);
0639 inc_nlink(d_inode(dentry->d_parent));
0640 fsnotify_mkdir(d_inode(dentry->d_parent), dentry);
0641 return end_creating(dentry);
0642 }
0643 EXPORT_SYMBOL(debugfs_create_automount);
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668 struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
0669 const char *target)
0670 {
0671 struct dentry *dentry;
0672 struct inode *inode;
0673 char *link = kstrdup(target, GFP_KERNEL);
0674 if (!link)
0675 return ERR_PTR(-ENOMEM);
0676
0677 dentry = start_creating(name, parent);
0678 if (IS_ERR(dentry)) {
0679 kfree(link);
0680 return dentry;
0681 }
0682
0683 inode = debugfs_get_inode(dentry->d_sb);
0684 if (unlikely(!inode)) {
0685 pr_err("out of free dentries, can not create symlink '%s'\n",
0686 name);
0687 kfree(link);
0688 return failed_creating(dentry);
0689 }
0690 inode->i_mode = S_IFLNK | S_IRWXUGO;
0691 inode->i_op = &debugfs_symlink_inode_operations;
0692 inode->i_link = link;
0693 d_instantiate(dentry, inode);
0694 return end_creating(dentry);
0695 }
0696 EXPORT_SYMBOL_GPL(debugfs_create_symlink);
0697
0698 static void __debugfs_file_removed(struct dentry *dentry)
0699 {
0700 struct debugfs_fsdata *fsd;
0701
0702
0703
0704
0705
0706
0707
0708 smp_mb();
0709 fsd = READ_ONCE(dentry->d_fsdata);
0710 if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
0711 return;
0712 if (!refcount_dec_and_test(&fsd->active_users))
0713 wait_for_completion(&fsd->active_users_drained);
0714 }
0715
0716 static void remove_one(struct dentry *victim)
0717 {
0718 if (d_is_reg(victim))
0719 __debugfs_file_removed(victim);
0720 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
0721 }
0722
0723
0724
0725
0726
0727
0728
0729
0730
0731
0732
0733
0734
0735
0736 void debugfs_remove(struct dentry *dentry)
0737 {
0738 if (IS_ERR_OR_NULL(dentry))
0739 return;
0740
0741 simple_pin_fs(&debug_fs_type, &debugfs_mount, &debugfs_mount_count);
0742 simple_recursive_removal(dentry, remove_one);
0743 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
0744 }
0745 EXPORT_SYMBOL_GPL(debugfs_remove);
0746
0747
0748
0749
0750
0751
0752
0753
0754
0755
0756 void debugfs_lookup_and_remove(const char *name, struct dentry *parent)
0757 {
0758 struct dentry *dentry;
0759
0760 dentry = debugfs_lookup(name, parent);
0761 if (!dentry)
0762 return;
0763
0764 debugfs_remove(dentry);
0765 dput(dentry);
0766 }
0767 EXPORT_SYMBOL_GPL(debugfs_lookup_and_remove);
0768
0769
0770
0771
0772
0773
0774
0775
0776
0777
0778
0779
0780
0781
0782
0783
0784
0785
0786
0787
0788 struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
0789 struct dentry *new_dir, const char *new_name)
0790 {
0791 int error;
0792 struct dentry *dentry = NULL, *trap;
0793 struct name_snapshot old_name;
0794
0795 if (IS_ERR(old_dir))
0796 return old_dir;
0797 if (IS_ERR(new_dir))
0798 return new_dir;
0799 if (IS_ERR_OR_NULL(old_dentry))
0800 return old_dentry;
0801
0802 trap = lock_rename(new_dir, old_dir);
0803
0804 if (d_really_is_negative(old_dir) || d_really_is_negative(new_dir))
0805 goto exit;
0806
0807 if (d_really_is_negative(old_dentry) || old_dentry == trap ||
0808 d_mountpoint(old_dentry))
0809 goto exit;
0810 dentry = lookup_one_len(new_name, new_dir, strlen(new_name));
0811
0812 if (IS_ERR(dentry) || dentry == trap || d_really_is_positive(dentry))
0813 goto exit;
0814
0815 take_dentry_name_snapshot(&old_name, old_dentry);
0816
0817 error = simple_rename(&init_user_ns, d_inode(old_dir), old_dentry,
0818 d_inode(new_dir), dentry, 0);
0819 if (error) {
0820 release_dentry_name_snapshot(&old_name);
0821 goto exit;
0822 }
0823 d_move(old_dentry, dentry);
0824 fsnotify_move(d_inode(old_dir), d_inode(new_dir), &old_name.name,
0825 d_is_dir(old_dentry),
0826 NULL, old_dentry);
0827 release_dentry_name_snapshot(&old_name);
0828 unlock_rename(new_dir, old_dir);
0829 dput(dentry);
0830 return old_dentry;
0831 exit:
0832 if (dentry && !IS_ERR(dentry))
0833 dput(dentry);
0834 unlock_rename(new_dir, old_dir);
0835 if (IS_ERR(dentry))
0836 return dentry;
0837 return ERR_PTR(-EINVAL);
0838 }
0839 EXPORT_SYMBOL_GPL(debugfs_rename);
0840
0841
0842
0843
0844 bool debugfs_initialized(void)
0845 {
0846 return debugfs_registered;
0847 }
0848 EXPORT_SYMBOL_GPL(debugfs_initialized);
0849
0850 static int __init debugfs_kernel(char *str)
0851 {
0852 if (str) {
0853 if (!strcmp(str, "on"))
0854 debugfs_allow = DEBUGFS_ALLOW_API | DEBUGFS_ALLOW_MOUNT;
0855 else if (!strcmp(str, "no-mount"))
0856 debugfs_allow = DEBUGFS_ALLOW_API;
0857 else if (!strcmp(str, "off"))
0858 debugfs_allow = 0;
0859 }
0860
0861 return 0;
0862 }
0863 early_param("debugfs", debugfs_kernel);
0864 static int __init debugfs_init(void)
0865 {
0866 int retval;
0867
0868 if (!(debugfs_allow & DEBUGFS_ALLOW_MOUNT))
0869 return -EPERM;
0870
0871 retval = sysfs_create_mount_point(kernel_kobj, "debug");
0872 if (retval)
0873 return retval;
0874
0875 retval = register_filesystem(&debug_fs_type);
0876 if (retval)
0877 sysfs_remove_mount_point(kernel_kobj, "debug");
0878 else
0879 debugfs_registered = true;
0880
0881 return retval;
0882 }
0883 core_initcall(debugfs_init);