generic.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. /*
  2. * proc/fs/generic.c --- generic routines for the proc-fs
  3. *
  4. * This file contains generic proc-fs routines for handling
  5. * directories and files.
  6. *
  7. * Copyright (C) 1991, 1992 Linus Torvalds.
  8. * Copyright (C) 1997 Theodore Ts'o
  9. */
  10. #include <linux/cache.h>
  11. #include <linux/errno.h>
  12. #include <linux/time.h>
  13. #include <linux/proc_fs.h>
  14. #include <linux/stat.h>
  15. #include <linux/mm.h>
  16. #include <linux/module.h>
  17. #include <linux/namei.h>
  18. #include <linux/slab.h>
  19. #include <linux/printk.h>
  20. #include <linux/mount.h>
  21. #include <linux/init.h>
  22. #include <linux/idr.h>
  23. #include <linux/bitops.h>
  24. #include <linux/spinlock.h>
  25. #include <linux/completion.h>
  26. #include <linux/uaccess.h>
  27. #include <linux/seq_file.h>
  28. #include "internal.h"
  29. static DEFINE_RWLOCK(proc_subdir_lock);
  30. struct kmem_cache *proc_dir_entry_cache __ro_after_init;
  31. void pde_free(struct proc_dir_entry *pde)
  32. {
  33. if (S_ISLNK(pde->mode))
  34. kfree(pde->data);
  35. if (pde->name != pde->inline_name)
  36. kfree(pde->name);
  37. kmem_cache_free(proc_dir_entry_cache, pde);
  38. }
  39. static int proc_match(const char *name, struct proc_dir_entry *de, unsigned int len)
  40. {
  41. if (len < de->namelen)
  42. return -1;
  43. if (len > de->namelen)
  44. return 1;
  45. return memcmp(name, de->name, len);
  46. }
  47. static struct proc_dir_entry *pde_subdir_first(struct proc_dir_entry *dir)
  48. {
  49. return rb_entry_safe(rb_first(&dir->subdir), struct proc_dir_entry,
  50. subdir_node);
  51. }
  52. static struct proc_dir_entry *pde_subdir_next(struct proc_dir_entry *dir)
  53. {
  54. return rb_entry_safe(rb_next(&dir->subdir_node), struct proc_dir_entry,
  55. subdir_node);
  56. }
  57. static struct proc_dir_entry *pde_subdir_find(struct proc_dir_entry *dir,
  58. const char *name,
  59. unsigned int len)
  60. {
  61. struct rb_node *node = dir->subdir.rb_node;
  62. while (node) {
  63. struct proc_dir_entry *de = rb_entry(node,
  64. struct proc_dir_entry,
  65. subdir_node);
  66. int result = proc_match(name, de, len);
  67. if (result < 0)
  68. node = node->rb_left;
  69. else if (result > 0)
  70. node = node->rb_right;
  71. else
  72. return de;
  73. }
  74. return NULL;
  75. }
  76. static bool pde_subdir_insert(struct proc_dir_entry *dir,
  77. struct proc_dir_entry *de)
  78. {
  79. struct rb_root *root = &dir->subdir;
  80. struct rb_node **new = &root->rb_node, *parent = NULL;
  81. /* Figure out where to put new node */
  82. while (*new) {
  83. struct proc_dir_entry *this = rb_entry(*new,
  84. struct proc_dir_entry,
  85. subdir_node);
  86. int result = proc_match(de->name, this, de->namelen);
  87. parent = *new;
  88. if (result < 0)
  89. new = &(*new)->rb_left;
  90. else if (result > 0)
  91. new = &(*new)->rb_right;
  92. else
  93. return false;
  94. }
  95. /* Add new node and rebalance tree. */
  96. rb_link_node(&de->subdir_node, parent, new);
  97. rb_insert_color(&de->subdir_node, root);
  98. return true;
  99. }
  100. static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
  101. {
  102. struct inode *inode = d_inode(dentry);
  103. struct proc_dir_entry *de = PDE(inode);
  104. int error;
  105. error = setattr_prepare(dentry, iattr);
  106. if (error)
  107. return error;
  108. setattr_copy(inode, iattr);
  109. mark_inode_dirty(inode);
  110. proc_set_user(de, inode->i_uid, inode->i_gid);
  111. de->mode = inode->i_mode;
  112. return 0;
  113. }
  114. static int proc_getattr(const struct path *path, struct kstat *stat,
  115. u32 request_mask, unsigned int query_flags)
  116. {
  117. struct inode *inode = d_inode(path->dentry);
  118. struct proc_dir_entry *de = PDE(inode);
  119. if (de && de->nlink)
  120. set_nlink(inode, de->nlink);
  121. generic_fillattr(inode, stat);
  122. return 0;
  123. }
  124. static const struct inode_operations proc_file_inode_operations = {
  125. .setattr = proc_notify_change,
  126. };
  127. /*
  128. * This function parses a name such as "tty/driver/serial", and
  129. * returns the struct proc_dir_entry for "/proc/tty/driver", and
  130. * returns "serial" in residual.
  131. */
  132. static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
  133. const char **residual)
  134. {
  135. const char *cp = name, *next;
  136. struct proc_dir_entry *de;
  137. unsigned int len;
  138. de = *ret;
  139. if (!de)
  140. de = &proc_root;
  141. while (1) {
  142. next = strchr(cp, '/');
  143. if (!next)
  144. break;
  145. len = next - cp;
  146. de = pde_subdir_find(de, cp, len);
  147. if (!de) {
  148. WARN(1, "name '%s'\n", name);
  149. return -ENOENT;
  150. }
  151. cp += len + 1;
  152. }
  153. *residual = cp;
  154. *ret = de;
  155. return 0;
  156. }
  157. static int xlate_proc_name(const char *name, struct proc_dir_entry **ret,
  158. const char **residual)
  159. {
  160. int rv;
  161. read_lock(&proc_subdir_lock);
  162. rv = __xlate_proc_name(name, ret, residual);
  163. read_unlock(&proc_subdir_lock);
  164. return rv;
  165. }
  166. static DEFINE_IDA(proc_inum_ida);
  167. #define PROC_DYNAMIC_FIRST 0xF0000000U
  168. /*
  169. * Return an inode number between PROC_DYNAMIC_FIRST and
  170. * 0xffffffff, or zero on failure.
  171. */
  172. int proc_alloc_inum(unsigned int *inum)
  173. {
  174. int i;
  175. i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1,
  176. GFP_KERNEL);
  177. if (i < 0)
  178. return i;
  179. *inum = PROC_DYNAMIC_FIRST + (unsigned int)i;
  180. return 0;
  181. }
  182. void proc_free_inum(unsigned int inum)
  183. {
  184. ida_simple_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST);
  185. }
  186. static int proc_misc_d_revalidate(struct dentry *dentry, unsigned int flags)
  187. {
  188. if (flags & LOOKUP_RCU)
  189. return -ECHILD;
  190. if (atomic_read(&PDE(d_inode(dentry))->in_use) < 0)
  191. return 0; /* revalidate */
  192. return 1;
  193. }
  194. static int proc_misc_d_delete(const struct dentry *dentry)
  195. {
  196. return atomic_read(&PDE(d_inode(dentry))->in_use) < 0;
  197. }
  198. static const struct dentry_operations proc_misc_dentry_ops = {
  199. .d_revalidate = proc_misc_d_revalidate,
  200. .d_delete = proc_misc_d_delete,
  201. };
  202. /*
  203. * Don't create negative dentries here, return -ENOENT by hand
  204. * instead.
  205. */
  206. struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry,
  207. struct proc_dir_entry *de)
  208. {
  209. struct inode *inode;
  210. read_lock(&proc_subdir_lock);
  211. de = pde_subdir_find(de, dentry->d_name.name, dentry->d_name.len);
  212. if (de) {
  213. pde_get(de);
  214. read_unlock(&proc_subdir_lock);
  215. inode = proc_get_inode(dir->i_sb, de);
  216. if (!inode)
  217. return ERR_PTR(-ENOMEM);
  218. d_set_d_op(dentry, &proc_misc_dentry_ops);
  219. d_add(dentry, inode);
  220. return NULL;
  221. }
  222. read_unlock(&proc_subdir_lock);
  223. return ERR_PTR(-ENOENT);
  224. }
  225. struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry,
  226. unsigned int flags)
  227. {
  228. return proc_lookup_de(dir, dentry, PDE(dir));
  229. }
  230. /*
  231. * This returns non-zero if at EOF, so that the /proc
  232. * root directory can use this and check if it should
  233. * continue with the <pid> entries..
  234. *
  235. * Note that the VFS-layer doesn't care about the return
  236. * value of the readdir() call, as long as it's non-negative
  237. * for success..
  238. */
  239. int proc_readdir_de(struct file *file, struct dir_context *ctx,
  240. struct proc_dir_entry *de)
  241. {
  242. int i;
  243. if (!dir_emit_dots(file, ctx))
  244. return 0;
  245. read_lock(&proc_subdir_lock);
  246. de = pde_subdir_first(de);
  247. i = ctx->pos - 2;
  248. for (;;) {
  249. if (!de) {
  250. read_unlock(&proc_subdir_lock);
  251. return 0;
  252. }
  253. if (!i)
  254. break;
  255. de = pde_subdir_next(de);
  256. i--;
  257. }
  258. do {
  259. struct proc_dir_entry *next;
  260. pde_get(de);
  261. read_unlock(&proc_subdir_lock);
  262. if (!dir_emit(ctx, de->name, de->namelen,
  263. de->low_ino, de->mode >> 12)) {
  264. pde_put(de);
  265. return 0;
  266. }
  267. read_lock(&proc_subdir_lock);
  268. ctx->pos++;
  269. next = pde_subdir_next(de);
  270. pde_put(de);
  271. de = next;
  272. } while (de);
  273. read_unlock(&proc_subdir_lock);
  274. return 1;
  275. }
  276. int proc_readdir(struct file *file, struct dir_context *ctx)
  277. {
  278. struct inode *inode = file_inode(file);
  279. return proc_readdir_de(file, ctx, PDE(inode));
  280. }
  281. /*
  282. * These are the generic /proc directory operations. They
  283. * use the in-memory "struct proc_dir_entry" tree to parse
  284. * the /proc directory.
  285. */
  286. static const struct file_operations proc_dir_operations = {
  287. .llseek = generic_file_llseek,
  288. .read = generic_read_dir,
  289. .iterate_shared = proc_readdir,
  290. };
  291. /*
  292. * proc directories can do almost nothing..
  293. */
  294. static const struct inode_operations proc_dir_inode_operations = {
  295. .lookup = proc_lookup,
  296. .getattr = proc_getattr,
  297. .setattr = proc_notify_change,
  298. };
  299. /* returns the registered entry, or frees dp and returns NULL on failure */
  300. struct proc_dir_entry *proc_register(struct proc_dir_entry *dir,
  301. struct proc_dir_entry *dp)
  302. {
  303. if (proc_alloc_inum(&dp->low_ino))
  304. goto out_free_entry;
  305. write_lock(&proc_subdir_lock);
  306. dp->parent = dir;
  307. if (pde_subdir_insert(dir, dp) == false) {
  308. WARN(1, "proc_dir_entry '%s/%s' already registered\n",
  309. dir->name, dp->name);
  310. write_unlock(&proc_subdir_lock);
  311. goto out_free_inum;
  312. }
  313. write_unlock(&proc_subdir_lock);
  314. return dp;
  315. out_free_inum:
  316. proc_free_inum(dp->low_ino);
  317. out_free_entry:
  318. pde_free(dp);
  319. return NULL;
  320. }
  321. static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
  322. const char *name,
  323. umode_t mode,
  324. nlink_t nlink)
  325. {
  326. struct proc_dir_entry *ent = NULL;
  327. const char *fn;
  328. struct qstr qstr;
  329. if (xlate_proc_name(name, parent, &fn) != 0)
  330. goto out;
  331. qstr.name = fn;
  332. qstr.len = strlen(fn);
  333. if (qstr.len == 0 || qstr.len >= 256) {
  334. WARN(1, "name len %u\n", qstr.len);
  335. return NULL;
  336. }
  337. if (qstr.len == 1 && fn[0] == '.') {
  338. WARN(1, "name '.'\n");
  339. return NULL;
  340. }
  341. if (qstr.len == 2 && fn[0] == '.' && fn[1] == '.') {
  342. WARN(1, "name '..'\n");
  343. return NULL;
  344. }
  345. if (*parent == &proc_root && name_to_int(&qstr) != ~0U) {
  346. WARN(1, "create '/proc/%s' by hand\n", qstr.name);
  347. return NULL;
  348. }
  349. if (is_empty_pde(*parent)) {
  350. WARN(1, "attempt to add to permanently empty directory");
  351. return NULL;
  352. }
  353. ent = kmem_cache_zalloc(proc_dir_entry_cache, GFP_KERNEL);
  354. if (!ent)
  355. goto out;
  356. if (qstr.len + 1 <= sizeof(ent->inline_name)) {
  357. ent->name = ent->inline_name;
  358. } else {
  359. ent->name = kmalloc(qstr.len + 1, GFP_KERNEL);
  360. if (!ent->name) {
  361. pde_free(ent);
  362. return NULL;
  363. }
  364. }
  365. memcpy(ent->name, fn, qstr.len + 1);
  366. ent->namelen = qstr.len;
  367. ent->mode = mode;
  368. ent->nlink = nlink;
  369. ent->subdir = RB_ROOT;
  370. refcount_set(&ent->refcnt, 1);
  371. spin_lock_init(&ent->pde_unload_lock);
  372. INIT_LIST_HEAD(&ent->pde_openers);
  373. proc_set_user(ent, (*parent)->uid, (*parent)->gid);
  374. out:
  375. return ent;
  376. }
  377. struct proc_dir_entry *proc_symlink(const char *name,
  378. struct proc_dir_entry *parent, const char *dest)
  379. {
  380. struct proc_dir_entry *ent;
  381. ent = __proc_create(&parent, name,
  382. (S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO),1);
  383. if (ent) {
  384. ent->data = kmalloc((ent->size=strlen(dest))+1, GFP_KERNEL);
  385. if (ent->data) {
  386. strcpy((char*)ent->data,dest);
  387. ent->proc_iops = &proc_link_inode_operations;
  388. ent = proc_register(parent, ent);
  389. } else {
  390. pde_free(ent);
  391. ent = NULL;
  392. }
  393. }
  394. return ent;
  395. }
  396. EXPORT_SYMBOL(proc_symlink);
  397. struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode,
  398. struct proc_dir_entry *parent, void *data)
  399. {
  400. struct proc_dir_entry *ent;
  401. if (mode == 0)
  402. mode = S_IRUGO | S_IXUGO;
  403. ent = __proc_create(&parent, name, S_IFDIR | mode, 2);
  404. if (ent) {
  405. ent->data = data;
  406. ent->proc_fops = &proc_dir_operations;
  407. ent->proc_iops = &proc_dir_inode_operations;
  408. parent->nlink++;
  409. ent = proc_register(parent, ent);
  410. if (!ent)
  411. parent->nlink--;
  412. }
  413. return ent;
  414. }
  415. EXPORT_SYMBOL_GPL(proc_mkdir_data);
  416. struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
  417. struct proc_dir_entry *parent)
  418. {
  419. return proc_mkdir_data(name, mode, parent, NULL);
  420. }
  421. EXPORT_SYMBOL(proc_mkdir_mode);
  422. struct proc_dir_entry *proc_mkdir(const char *name,
  423. struct proc_dir_entry *parent)
  424. {
  425. return proc_mkdir_data(name, 0, parent, NULL);
  426. }
  427. EXPORT_SYMBOL(proc_mkdir);
  428. struct proc_dir_entry *proc_create_mount_point(const char *name)
  429. {
  430. umode_t mode = S_IFDIR | S_IRUGO | S_IXUGO;
  431. struct proc_dir_entry *ent, *parent = NULL;
  432. ent = __proc_create(&parent, name, mode, 2);
  433. if (ent) {
  434. ent->data = NULL;
  435. ent->proc_fops = NULL;
  436. ent->proc_iops = NULL;
  437. parent->nlink++;
  438. ent = proc_register(parent, ent);
  439. if (!ent)
  440. parent->nlink--;
  441. }
  442. return ent;
  443. }
  444. EXPORT_SYMBOL(proc_create_mount_point);
  445. struct proc_dir_entry *proc_create_reg(const char *name, umode_t mode,
  446. struct proc_dir_entry **parent, void *data)
  447. {
  448. struct proc_dir_entry *p;
  449. if ((mode & S_IFMT) == 0)
  450. mode |= S_IFREG;
  451. if ((mode & S_IALLUGO) == 0)
  452. mode |= S_IRUGO;
  453. if (WARN_ON_ONCE(!S_ISREG(mode)))
  454. return NULL;
  455. p = __proc_create(parent, name, mode, 1);
  456. if (p) {
  457. p->proc_iops = &proc_file_inode_operations;
  458. p->data = data;
  459. }
  460. return p;
  461. }
  462. struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
  463. struct proc_dir_entry *parent,
  464. const struct file_operations *proc_fops, void *data)
  465. {
  466. struct proc_dir_entry *p;
  467. BUG_ON(proc_fops == NULL);
  468. p = proc_create_reg(name, mode, &parent, data);
  469. if (!p)
  470. return NULL;
  471. p->proc_fops = proc_fops;
  472. return proc_register(parent, p);
  473. }
  474. EXPORT_SYMBOL(proc_create_data);
  475. struct proc_dir_entry *proc_create(const char *name, umode_t mode,
  476. struct proc_dir_entry *parent,
  477. const struct file_operations *proc_fops)
  478. {
  479. return proc_create_data(name, mode, parent, proc_fops, NULL);
  480. }
  481. EXPORT_SYMBOL(proc_create);
  482. static int proc_seq_open(struct inode *inode, struct file *file)
  483. {
  484. struct proc_dir_entry *de = PDE(inode);
  485. return seq_open(file, de->seq_ops);
  486. }
  487. static const struct file_operations proc_seq_fops = {
  488. .open = proc_seq_open,
  489. .read = seq_read,
  490. .llseek = seq_lseek,
  491. .release = seq_release,
  492. };
  493. struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode,
  494. struct proc_dir_entry *parent, const struct seq_operations *ops,
  495. void *data)
  496. {
  497. struct proc_dir_entry *p;
  498. p = proc_create_reg(name, mode, &parent, data);
  499. if (!p)
  500. return NULL;
  501. p->proc_fops = &proc_seq_fops;
  502. p->seq_ops = ops;
  503. return proc_register(parent, p);
  504. }
  505. EXPORT_SYMBOL(proc_create_seq_data);
  506. void proc_set_size(struct proc_dir_entry *de, loff_t size)
  507. {
  508. de->size = size;
  509. }
  510. EXPORT_SYMBOL(proc_set_size);
  511. void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid)
  512. {
  513. de->uid = uid;
  514. de->gid = gid;
  515. }
  516. EXPORT_SYMBOL(proc_set_user);
  517. void pde_put(struct proc_dir_entry *pde)
  518. {
  519. if (refcount_dec_and_test(&pde->refcnt)) {
  520. proc_free_inum(pde->low_ino);
  521. pde_free(pde);
  522. }
  523. }
  524. /*
  525. * Remove a /proc entry and free it if it's not currently in use.
  526. */
  527. void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
  528. {
  529. struct proc_dir_entry *de = NULL;
  530. const char *fn = name;
  531. unsigned int len;
  532. write_lock(&proc_subdir_lock);
  533. if (__xlate_proc_name(name, &parent, &fn) != 0) {
  534. write_unlock(&proc_subdir_lock);
  535. return;
  536. }
  537. len = strlen(fn);
  538. de = pde_subdir_find(parent, fn, len);
  539. if (de)
  540. rb_erase(&de->subdir_node, &parent->subdir);
  541. write_unlock(&proc_subdir_lock);
  542. if (!de) {
  543. WARN(1, "name '%s'\n", name);
  544. return;
  545. }
  546. proc_entry_rundown(de);
  547. if (S_ISDIR(de->mode))
  548. parent->nlink--;
  549. de->nlink = 0;
  550. WARN(pde_subdir_first(de),
  551. "%s: removing non-empty directory '%s/%s', leaking at least '%s'\n",
  552. __func__, de->parent->name, de->name, pde_subdir_first(de)->name);
  553. pde_put(de);
  554. }
  555. EXPORT_SYMBOL(remove_proc_entry);
  556. int remove_proc_subtree(const char *name, struct proc_dir_entry *parent)
  557. {
  558. struct proc_dir_entry *root = NULL, *de, *next;
  559. const char *fn = name;
  560. unsigned int len;
  561. write_lock(&proc_subdir_lock);
  562. if (__xlate_proc_name(name, &parent, &fn) != 0) {
  563. write_unlock(&proc_subdir_lock);
  564. return -ENOENT;
  565. }
  566. len = strlen(fn);
  567. root = pde_subdir_find(parent, fn, len);
  568. if (!root) {
  569. write_unlock(&proc_subdir_lock);
  570. return -ENOENT;
  571. }
  572. rb_erase(&root->subdir_node, &parent->subdir);
  573. de = root;
  574. while (1) {
  575. next = pde_subdir_first(de);
  576. if (next) {
  577. rb_erase(&next->subdir_node, &de->subdir);
  578. de = next;
  579. continue;
  580. }
  581. write_unlock(&proc_subdir_lock);
  582. proc_entry_rundown(de);
  583. next = de->parent;
  584. if (S_ISDIR(de->mode))
  585. next->nlink--;
  586. de->nlink = 0;
  587. if (de == root)
  588. break;
  589. pde_put(de);
  590. write_lock(&proc_subdir_lock);
  591. de = next;
  592. }
  593. pde_put(root);
  594. return 0;
  595. }
  596. EXPORT_SYMBOL(remove_proc_subtree);
  597. void *proc_get_parent_data(const struct inode *inode)
  598. {
  599. struct proc_dir_entry *de = PDE(inode);
  600. return de->parent->data;
  601. }
  602. EXPORT_SYMBOL_GPL(proc_get_parent_data);
  603. void proc_remove(struct proc_dir_entry *de)
  604. {
  605. if (de)
  606. remove_proc_subtree(de->name, de->parent);
  607. }
  608. EXPORT_SYMBOL(proc_remove);
  609. void *PDE_DATA(const struct inode *inode)
  610. {
  611. return __PDE_DATA(inode);
  612. }
  613. EXPORT_SYMBOL(PDE_DATA);