internal.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* fs/ internal definitions
  2. *
  3. * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/lglock.h>
  12. struct super_block;
  13. struct linux_binprm;
  14. struct path;
  15. /*
  16. * block_dev.c
  17. */
  18. #ifdef CONFIG_BLOCK
  19. extern struct super_block *blockdev_superblock;
  20. extern void __init bdev_cache_init(void);
  21. static inline int sb_is_blkdev_sb(struct super_block *sb)
  22. {
  23. return sb == blockdev_superblock;
  24. }
  25. extern int __sync_blockdev(struct block_device *bdev, int wait);
  26. #else
  27. static inline void bdev_cache_init(void)
  28. {
  29. }
  30. static inline int sb_is_blkdev_sb(struct super_block *sb)
  31. {
  32. return 0;
  33. }
  34. static inline int __sync_blockdev(struct block_device *bdev, int wait)
  35. {
  36. return 0;
  37. }
  38. #endif
  39. /*
  40. * char_dev.c
  41. */
  42. extern void __init chrdev_init(void);
  43. /*
  44. * exec.c
  45. */
  46. extern int check_unsafe_exec(struct linux_binprm *);
  47. /*
  48. * namespace.c
  49. */
  50. extern int copy_mount_options(const void __user *, unsigned long *);
  51. extern int copy_mount_string(const void __user *, char **);
  52. extern void free_vfsmnt(struct vfsmount *);
  53. extern struct vfsmount *alloc_vfsmnt(const char *);
  54. extern unsigned int mnt_get_count(struct vfsmount *mnt);
  55. extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
  56. extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
  57. struct vfsmount *);
  58. extern void release_mounts(struct list_head *);
  59. extern void umount_tree(struct vfsmount *, int, struct list_head *);
  60. extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
  61. extern void __init mnt_init(void);
  62. DECLARE_BRLOCK(vfsmount_lock);
  63. /*
  64. * fs_struct.c
  65. */
  66. extern void chroot_fs_refs(struct path *, struct path *);
  67. /*
  68. * file_table.c
  69. */
  70. extern void file_sb_list_add(struct file *f, struct super_block *sb);
  71. extern void file_sb_list_del(struct file *f);
  72. extern void mark_files_ro(struct super_block *);
  73. extern struct file *get_empty_filp(void);
  74. /*
  75. * super.c
  76. */
  77. extern int do_remount_sb(struct super_block *, int, void *, int);
  78. extern void __put_super(struct super_block *sb);
  79. extern void put_super(struct super_block *sb);
  80. /*
  81. * open.c
  82. */
  83. struct nameidata;
  84. extern struct file *nameidata_to_filp(struct nameidata *);
  85. extern void release_open_intent(struct nameidata *);
  86. /*
  87. * inode.c
  88. */
  89. extern int get_nr_dirty_inodes(void);
  90. extern void evict_inodes(struct super_block *);
  91. extern int invalidate_inodes(struct super_block *);