libfs.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. /*
  2. * fs/libfs.c
  3. * Library for filesystems writers.
  4. */
  5. #include <linux/module.h>
  6. #include <linux/pagemap.h>
  7. #include <linux/mount.h>
  8. #include <linux/vfs.h>
  9. #include <linux/mutex.h>
  10. #include <asm/uaccess.h>
  11. int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
  12. struct kstat *stat)
  13. {
  14. struct inode *inode = dentry->d_inode;
  15. generic_fillattr(inode, stat);
  16. stat->blocks = inode->i_mapping->nrpages << (PAGE_CACHE_SHIFT - 9);
  17. return 0;
  18. }
  19. int simple_statfs(struct dentry *dentry, struct kstatfs *buf)
  20. {
  21. buf->f_type = dentry->d_sb->s_magic;
  22. buf->f_bsize = PAGE_CACHE_SIZE;
  23. buf->f_namelen = NAME_MAX;
  24. return 0;
  25. }
  26. /*
  27. * Retaining negative dentries for an in-memory filesystem just wastes
  28. * memory and lookup time: arrange for them to be deleted immediately.
  29. */
  30. static int simple_delete_dentry(struct dentry *dentry)
  31. {
  32. return 1;
  33. }
  34. /*
  35. * Lookup the data. This is trivial - if the dentry didn't already
  36. * exist, we know it is negative. Set d_op to delete negative dentries.
  37. */
  38. struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
  39. {
  40. static struct dentry_operations simple_dentry_operations = {
  41. .d_delete = simple_delete_dentry,
  42. };
  43. if (dentry->d_name.len > NAME_MAX)
  44. return ERR_PTR(-ENAMETOOLONG);
  45. dentry->d_op = &simple_dentry_operations;
  46. d_add(dentry, NULL);
  47. return NULL;
  48. }
  49. int simple_sync_file(struct file * file, struct dentry *dentry, int datasync)
  50. {
  51. return 0;
  52. }
  53. int dcache_dir_open(struct inode *inode, struct file *file)
  54. {
  55. static struct qstr cursor_name = {.len = 1, .name = "."};
  56. file->private_data = d_alloc(file->f_path.dentry, &cursor_name);
  57. return file->private_data ? 0 : -ENOMEM;
  58. }
  59. int dcache_dir_close(struct inode *inode, struct file *file)
  60. {
  61. dput(file->private_data);
  62. return 0;
  63. }
  64. loff_t dcache_dir_lseek(struct file *file, loff_t offset, int origin)
  65. {
  66. mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
  67. switch (origin) {
  68. case 1:
  69. offset += file->f_pos;
  70. case 0:
  71. if (offset >= 0)
  72. break;
  73. default:
  74. mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
  75. return -EINVAL;
  76. }
  77. if (offset != file->f_pos) {
  78. file->f_pos = offset;
  79. if (file->f_pos >= 2) {
  80. struct list_head *p;
  81. struct dentry *cursor = file->private_data;
  82. loff_t n = file->f_pos - 2;
  83. spin_lock(&dcache_lock);
  84. list_del(&cursor->d_u.d_child);
  85. p = file->f_path.dentry->d_subdirs.next;
  86. while (n && p != &file->f_path.dentry->d_subdirs) {
  87. struct dentry *next;
  88. next = list_entry(p, struct dentry, d_u.d_child);
  89. if (!d_unhashed(next) && next->d_inode)
  90. n--;
  91. p = p->next;
  92. }
  93. list_add_tail(&cursor->d_u.d_child, p);
  94. spin_unlock(&dcache_lock);
  95. }
  96. }
  97. mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
  98. return offset;
  99. }
  100. /* Relationship between i_mode and the DT_xxx types */
  101. static inline unsigned char dt_type(struct inode *inode)
  102. {
  103. return (inode->i_mode >> 12) & 15;
  104. }
  105. /*
  106. * Directory is locked and all positive dentries in it are safe, since
  107. * for ramfs-type trees they can't go away without unlink() or rmdir(),
  108. * both impossible due to the lock on directory.
  109. */
  110. int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
  111. {
  112. struct dentry *dentry = filp->f_path.dentry;
  113. struct dentry *cursor = filp->private_data;
  114. struct list_head *p, *q = &cursor->d_u.d_child;
  115. ino_t ino;
  116. int i = filp->f_pos;
  117. switch (i) {
  118. case 0:
  119. ino = dentry->d_inode->i_ino;
  120. if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0)
  121. break;
  122. filp->f_pos++;
  123. i++;
  124. /* fallthrough */
  125. case 1:
  126. ino = parent_ino(dentry);
  127. if (filldir(dirent, "..", 2, i, ino, DT_DIR) < 0)
  128. break;
  129. filp->f_pos++;
  130. i++;
  131. /* fallthrough */
  132. default:
  133. spin_lock(&dcache_lock);
  134. if (filp->f_pos == 2)
  135. list_move(q, &dentry->d_subdirs);
  136. for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
  137. struct dentry *next;
  138. next = list_entry(p, struct dentry, d_u.d_child);
  139. if (d_unhashed(next) || !next->d_inode)
  140. continue;
  141. spin_unlock(&dcache_lock);
  142. if (filldir(dirent, next->d_name.name,
  143. next->d_name.len, filp->f_pos,
  144. next->d_inode->i_ino,
  145. dt_type(next->d_inode)) < 0)
  146. return 0;
  147. spin_lock(&dcache_lock);
  148. /* next is still alive */
  149. list_move(q, p);
  150. p = q;
  151. filp->f_pos++;
  152. }
  153. spin_unlock(&dcache_lock);
  154. }
  155. return 0;
  156. }
  157. ssize_t generic_read_dir(struct file *filp, char __user *buf, size_t siz, loff_t *ppos)
  158. {
  159. return -EISDIR;
  160. }
  161. const struct file_operations simple_dir_operations = {
  162. .open = dcache_dir_open,
  163. .release = dcache_dir_close,
  164. .llseek = dcache_dir_lseek,
  165. .read = generic_read_dir,
  166. .readdir = dcache_readdir,
  167. .fsync = simple_sync_file,
  168. };
  169. const struct inode_operations simple_dir_inode_operations = {
  170. .lookup = simple_lookup,
  171. };
  172. static const struct super_operations simple_super_operations = {
  173. .statfs = simple_statfs,
  174. };
  175. /*
  176. * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
  177. * will never be mountable)
  178. */
  179. int get_sb_pseudo(struct file_system_type *fs_type, char *name,
  180. const struct super_operations *ops, unsigned long magic,
  181. struct vfsmount *mnt)
  182. {
  183. struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
  184. struct dentry *dentry;
  185. struct inode *root;
  186. struct qstr d_name = {.name = name, .len = strlen(name)};
  187. if (IS_ERR(s))
  188. return PTR_ERR(s);
  189. s->s_flags = MS_NOUSER;
  190. s->s_maxbytes = ~0ULL;
  191. s->s_blocksize = 1024;
  192. s->s_blocksize_bits = 10;
  193. s->s_magic = magic;
  194. s->s_op = ops ? ops : &simple_super_operations;
  195. s->s_time_gran = 1;
  196. root = new_inode(s);
  197. if (!root)
  198. goto Enomem;
  199. /*
  200. * since this is the first inode, make it number 1. New inodes created
  201. * after this must take care not to collide with it (by passing
  202. * max_reserved of 1 to iunique).
  203. */
  204. root->i_ino = 1;
  205. root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR;
  206. root->i_uid = root->i_gid = 0;
  207. root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME;
  208. dentry = d_alloc(NULL, &d_name);
  209. if (!dentry) {
  210. iput(root);
  211. goto Enomem;
  212. }
  213. dentry->d_sb = s;
  214. dentry->d_parent = dentry;
  215. d_instantiate(dentry, root);
  216. s->s_root = dentry;
  217. s->s_flags |= MS_ACTIVE;
  218. return simple_set_mnt(mnt, s);
  219. Enomem:
  220. up_write(&s->s_umount);
  221. deactivate_super(s);
  222. return -ENOMEM;
  223. }
  224. int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
  225. {
  226. struct inode *inode = old_dentry->d_inode;
  227. inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
  228. inc_nlink(inode);
  229. atomic_inc(&inode->i_count);
  230. dget(dentry);
  231. d_instantiate(dentry, inode);
  232. return 0;
  233. }
  234. static inline int simple_positive(struct dentry *dentry)
  235. {
  236. return dentry->d_inode && !d_unhashed(dentry);
  237. }
  238. int simple_empty(struct dentry *dentry)
  239. {
  240. struct dentry *child;
  241. int ret = 0;
  242. spin_lock(&dcache_lock);
  243. list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child)
  244. if (simple_positive(child))
  245. goto out;
  246. ret = 1;
  247. out:
  248. spin_unlock(&dcache_lock);
  249. return ret;
  250. }
  251. int simple_unlink(struct inode *dir, struct dentry *dentry)
  252. {
  253. struct inode *inode = dentry->d_inode;
  254. inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
  255. drop_nlink(inode);
  256. dput(dentry);
  257. return 0;
  258. }
  259. int simple_rmdir(struct inode *dir, struct dentry *dentry)
  260. {
  261. if (!simple_empty(dentry))
  262. return -ENOTEMPTY;
  263. drop_nlink(dentry->d_inode);
  264. simple_unlink(dir, dentry);
  265. drop_nlink(dir);
  266. return 0;
  267. }
  268. int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
  269. struct inode *new_dir, struct dentry *new_dentry)
  270. {
  271. struct inode *inode = old_dentry->d_inode;
  272. int they_are_dirs = S_ISDIR(old_dentry->d_inode->i_mode);
  273. if (!simple_empty(new_dentry))
  274. return -ENOTEMPTY;
  275. if (new_dentry->d_inode) {
  276. simple_unlink(new_dir, new_dentry);
  277. if (they_are_dirs)
  278. drop_nlink(old_dir);
  279. } else if (they_are_dirs) {
  280. drop_nlink(old_dir);
  281. inc_nlink(new_dir);
  282. }
  283. old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
  284. new_dir->i_mtime = inode->i_ctime = CURRENT_TIME;
  285. return 0;
  286. }
  287. int simple_readpage(struct file *file, struct page *page)
  288. {
  289. clear_highpage(page);
  290. flush_dcache_page(page);
  291. SetPageUptodate(page);
  292. unlock_page(page);
  293. return 0;
  294. }
  295. int simple_prepare_write(struct file *file, struct page *page,
  296. unsigned from, unsigned to)
  297. {
  298. if (!PageUptodate(page)) {
  299. if (to - from != PAGE_CACHE_SIZE) {
  300. void *kaddr = kmap_atomic(page, KM_USER0);
  301. memset(kaddr, 0, from);
  302. memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
  303. flush_dcache_page(page);
  304. kunmap_atomic(kaddr, KM_USER0);
  305. }
  306. }
  307. return 0;
  308. }
  309. int simple_write_begin(struct file *file, struct address_space *mapping,
  310. loff_t pos, unsigned len, unsigned flags,
  311. struct page **pagep, void **fsdata)
  312. {
  313. struct page *page;
  314. pgoff_t index;
  315. unsigned from;
  316. index = pos >> PAGE_CACHE_SHIFT;
  317. from = pos & (PAGE_CACHE_SIZE - 1);
  318. page = __grab_cache_page(mapping, index);
  319. if (!page)
  320. return -ENOMEM;
  321. *pagep = page;
  322. return simple_prepare_write(file, page, from, from+len);
  323. }
  324. static int simple_commit_write(struct file *file, struct page *page,
  325. unsigned from, unsigned to)
  326. {
  327. struct inode *inode = page->mapping->host;
  328. loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
  329. if (!PageUptodate(page))
  330. SetPageUptodate(page);
  331. /*
  332. * No need to use i_size_read() here, the i_size
  333. * cannot change under us because we hold the i_mutex.
  334. */
  335. if (pos > inode->i_size)
  336. i_size_write(inode, pos);
  337. set_page_dirty(page);
  338. return 0;
  339. }
  340. int simple_write_end(struct file *file, struct address_space *mapping,
  341. loff_t pos, unsigned len, unsigned copied,
  342. struct page *page, void *fsdata)
  343. {
  344. unsigned from = pos & (PAGE_CACHE_SIZE - 1);
  345. /* zero the stale part of the page if we did a short copy */
  346. if (copied < len) {
  347. void *kaddr = kmap_atomic(page, KM_USER0);
  348. memset(kaddr + from + copied, 0, len - copied);
  349. flush_dcache_page(page);
  350. kunmap_atomic(kaddr, KM_USER0);
  351. }
  352. simple_commit_write(file, page, from, from+copied);
  353. unlock_page(page);
  354. page_cache_release(page);
  355. return copied;
  356. }
  357. /*
  358. * the inodes created here are not hashed. If you use iunique to generate
  359. * unique inode values later for this filesystem, then you must take care
  360. * to pass it an appropriate max_reserved value to avoid collisions.
  361. */
  362. int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files)
  363. {
  364. struct inode *inode;
  365. struct dentry *root;
  366. struct dentry *dentry;
  367. int i;
  368. s->s_blocksize = PAGE_CACHE_SIZE;
  369. s->s_blocksize_bits = PAGE_CACHE_SHIFT;
  370. s->s_magic = magic;
  371. s->s_op = &simple_super_operations;
  372. s->s_time_gran = 1;
  373. inode = new_inode(s);
  374. if (!inode)
  375. return -ENOMEM;
  376. /*
  377. * because the root inode is 1, the files array must not contain an
  378. * entry at index 1
  379. */
  380. inode->i_ino = 1;
  381. inode->i_mode = S_IFDIR | 0755;
  382. inode->i_uid = inode->i_gid = 0;
  383. inode->i_blocks = 0;
  384. inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
  385. inode->i_op = &simple_dir_inode_operations;
  386. inode->i_fop = &simple_dir_operations;
  387. inode->i_nlink = 2;
  388. root = d_alloc_root(inode);
  389. if (!root) {
  390. iput(inode);
  391. return -ENOMEM;
  392. }
  393. for (i = 0; !files->name || files->name[0]; i++, files++) {
  394. if (!files->name)
  395. continue;
  396. /* warn if it tries to conflict with the root inode */
  397. if (unlikely(i == 1))
  398. printk(KERN_WARNING "%s: %s passed in a files array"
  399. "with an index of 1!\n", __func__,
  400. s->s_type->name);
  401. dentry = d_alloc_name(root, files->name);
  402. if (!dentry)
  403. goto out;
  404. inode = new_inode(s);
  405. if (!inode)
  406. goto out;
  407. inode->i_mode = S_IFREG | files->mode;
  408. inode->i_uid = inode->i_gid = 0;
  409. inode->i_blocks = 0;
  410. inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
  411. inode->i_fop = files->ops;
  412. inode->i_ino = i;
  413. d_add(dentry, inode);
  414. }
  415. s->s_root = root;
  416. return 0;
  417. out:
  418. d_genocide(root);
  419. dput(root);
  420. return -ENOMEM;
  421. }
  422. static DEFINE_SPINLOCK(pin_fs_lock);
  423. int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *count)
  424. {
  425. struct vfsmount *mnt = NULL;
  426. spin_lock(&pin_fs_lock);
  427. if (unlikely(!*mount)) {
  428. spin_unlock(&pin_fs_lock);
  429. mnt = vfs_kern_mount(type, 0, type->name, NULL);
  430. if (IS_ERR(mnt))
  431. return PTR_ERR(mnt);
  432. spin_lock(&pin_fs_lock);
  433. if (!*mount)
  434. *mount = mnt;
  435. }
  436. mntget(*mount);
  437. ++*count;
  438. spin_unlock(&pin_fs_lock);
  439. mntput(mnt);
  440. return 0;
  441. }
  442. void simple_release_fs(struct vfsmount **mount, int *count)
  443. {
  444. struct vfsmount *mnt;
  445. spin_lock(&pin_fs_lock);
  446. mnt = *mount;
  447. if (!--*count)
  448. *mount = NULL;
  449. spin_unlock(&pin_fs_lock);
  450. mntput(mnt);
  451. }
  452. ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos,
  453. const void *from, size_t available)
  454. {
  455. loff_t pos = *ppos;
  456. if (pos < 0)
  457. return -EINVAL;
  458. if (pos >= available)
  459. return 0;
  460. if (count > available - pos)
  461. count = available - pos;
  462. if (copy_to_user(to, from + pos, count))
  463. return -EFAULT;
  464. *ppos = pos + count;
  465. return count;
  466. }
  467. /*
  468. * Transaction based IO.
  469. * The file expects a single write which triggers the transaction, and then
  470. * possibly a read which collects the result - which is stored in a
  471. * file-local buffer.
  472. */
  473. char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
  474. {
  475. struct simple_transaction_argresp *ar;
  476. static DEFINE_SPINLOCK(simple_transaction_lock);
  477. if (size > SIMPLE_TRANSACTION_LIMIT - 1)
  478. return ERR_PTR(-EFBIG);
  479. ar = (struct simple_transaction_argresp *)get_zeroed_page(GFP_KERNEL);
  480. if (!ar)
  481. return ERR_PTR(-ENOMEM);
  482. spin_lock(&simple_transaction_lock);
  483. /* only one write allowed per open */
  484. if (file->private_data) {
  485. spin_unlock(&simple_transaction_lock);
  486. free_page((unsigned long)ar);
  487. return ERR_PTR(-EBUSY);
  488. }
  489. file->private_data = ar;
  490. spin_unlock(&simple_transaction_lock);
  491. if (copy_from_user(ar->data, buf, size))
  492. return ERR_PTR(-EFAULT);
  493. return ar->data;
  494. }
  495. ssize_t simple_transaction_read(struct file *file, char __user *buf, size_t size, loff_t *pos)
  496. {
  497. struct simple_transaction_argresp *ar = file->private_data;
  498. if (!ar)
  499. return 0;
  500. return simple_read_from_buffer(buf, size, pos, ar->data, ar->size);
  501. }
  502. int simple_transaction_release(struct inode *inode, struct file *file)
  503. {
  504. free_page((unsigned long)file->private_data);
  505. return 0;
  506. }
  507. /* Simple attribute files */
  508. struct simple_attr {
  509. u64 (*get)(void *);
  510. void (*set)(void *, u64);
  511. char get_buf[24]; /* enough to store a u64 and "\n\0" */
  512. char set_buf[24];
  513. void *data;
  514. const char *fmt; /* format for read operation */
  515. struct mutex mutex; /* protects access to these buffers */
  516. };
  517. /* simple_attr_open is called by an actual attribute open file operation
  518. * to set the attribute specific access operations. */
  519. int simple_attr_open(struct inode *inode, struct file *file,
  520. u64 (*get)(void *), void (*set)(void *, u64),
  521. const char *fmt)
  522. {
  523. struct simple_attr *attr;
  524. attr = kmalloc(sizeof(*attr), GFP_KERNEL);
  525. if (!attr)
  526. return -ENOMEM;
  527. attr->get = get;
  528. attr->set = set;
  529. attr->data = inode->i_private;
  530. attr->fmt = fmt;
  531. mutex_init(&attr->mutex);
  532. file->private_data = attr;
  533. return nonseekable_open(inode, file);
  534. }
  535. int simple_attr_close(struct inode *inode, struct file *file)
  536. {
  537. kfree(file->private_data);
  538. return 0;
  539. }
  540. /* read from the buffer that is filled with the get function */
  541. ssize_t simple_attr_read(struct file *file, char __user *buf,
  542. size_t len, loff_t *ppos)
  543. {
  544. struct simple_attr *attr;
  545. size_t size;
  546. ssize_t ret;
  547. attr = file->private_data;
  548. if (!attr->get)
  549. return -EACCES;
  550. mutex_lock(&attr->mutex);
  551. if (*ppos) /* continued read */
  552. size = strlen(attr->get_buf);
  553. else /* first read */
  554. size = scnprintf(attr->get_buf, sizeof(attr->get_buf),
  555. attr->fmt,
  556. (unsigned long long)attr->get(attr->data));
  557. ret = simple_read_from_buffer(buf, len, ppos, attr->get_buf, size);
  558. mutex_unlock(&attr->mutex);
  559. return ret;
  560. }
  561. /* interpret the buffer as a number to call the set function with */
  562. ssize_t simple_attr_write(struct file *file, const char __user *buf,
  563. size_t len, loff_t *ppos)
  564. {
  565. struct simple_attr *attr;
  566. u64 val;
  567. size_t size;
  568. ssize_t ret;
  569. attr = file->private_data;
  570. if (!attr->set)
  571. return -EACCES;
  572. mutex_lock(&attr->mutex);
  573. ret = -EFAULT;
  574. size = min(sizeof(attr->set_buf) - 1, len);
  575. if (copy_from_user(attr->set_buf, buf, size))
  576. goto out;
  577. ret = len; /* claim we got the whole input */
  578. attr->set_buf[size] = '\0';
  579. val = simple_strtol(attr->set_buf, NULL, 0);
  580. attr->set(attr->data, val);
  581. out:
  582. mutex_unlock(&attr->mutex);
  583. return ret;
  584. }
  585. EXPORT_SYMBOL(dcache_dir_close);
  586. EXPORT_SYMBOL(dcache_dir_lseek);
  587. EXPORT_SYMBOL(dcache_dir_open);
  588. EXPORT_SYMBOL(dcache_readdir);
  589. EXPORT_SYMBOL(generic_read_dir);
  590. EXPORT_SYMBOL(get_sb_pseudo);
  591. EXPORT_SYMBOL(simple_write_begin);
  592. EXPORT_SYMBOL(simple_write_end);
  593. EXPORT_SYMBOL(simple_dir_inode_operations);
  594. EXPORT_SYMBOL(simple_dir_operations);
  595. EXPORT_SYMBOL(simple_empty);
  596. EXPORT_SYMBOL(d_alloc_name);
  597. EXPORT_SYMBOL(simple_fill_super);
  598. EXPORT_SYMBOL(simple_getattr);
  599. EXPORT_SYMBOL(simple_link);
  600. EXPORT_SYMBOL(simple_lookup);
  601. EXPORT_SYMBOL(simple_pin_fs);
  602. EXPORT_SYMBOL(simple_prepare_write);
  603. EXPORT_SYMBOL(simple_readpage);
  604. EXPORT_SYMBOL(simple_release_fs);
  605. EXPORT_SYMBOL(simple_rename);
  606. EXPORT_SYMBOL(simple_rmdir);
  607. EXPORT_SYMBOL(simple_statfs);
  608. EXPORT_SYMBOL(simple_sync_file);
  609. EXPORT_SYMBOL(simple_unlink);
  610. EXPORT_SYMBOL(simple_read_from_buffer);
  611. EXPORT_SYMBOL(simple_transaction_get);
  612. EXPORT_SYMBOL(simple_transaction_read);
  613. EXPORT_SYMBOL(simple_transaction_release);
  614. EXPORT_SYMBOL_GPL(simple_attr_open);
  615. EXPORT_SYMBOL_GPL(simple_attr_close);
  616. EXPORT_SYMBOL_GPL(simple_attr_read);
  617. EXPORT_SYMBOL_GPL(simple_attr_write);