internal.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 file_system_type;
  14. struct linux_binprm;
  15. struct path;
  16. /*
  17. * block_dev.c
  18. */
  19. #ifdef CONFIG_BLOCK
  20. extern struct super_block *blockdev_superblock;
  21. extern void __init bdev_cache_init(void);
  22. static inline int sb_is_blkdev_sb(struct super_block *sb)
  23. {
  24. return sb == blockdev_superblock;
  25. }
  26. extern int __sync_blockdev(struct block_device *bdev, int wait);
  27. #else
  28. static inline void bdev_cache_init(void)
  29. {
  30. }
  31. static inline int sb_is_blkdev_sb(struct super_block *sb)
  32. {
  33. return 0;
  34. }
  35. static inline int __sync_blockdev(struct block_device *bdev, int wait)
  36. {
  37. return 0;
  38. }
  39. #endif
  40. /*
  41. * char_dev.c
  42. */
  43. extern void __init chrdev_init(void);
  44. /*
  45. * exec.c
  46. */
  47. extern int check_unsafe_exec(struct linux_binprm *);
  48. /*
  49. * namespace.c
  50. */
  51. extern int copy_mount_options(const void __user *, unsigned long *);
  52. extern int copy_mount_string(const void __user *, char **);
  53. extern unsigned int mnt_get_count(struct vfsmount *mnt);
  54. extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
  55. extern struct vfsmount *lookup_mnt(struct path *);
  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 int finish_automount(struct vfsmount *, struct path *);
  62. extern void mnt_make_longterm(struct vfsmount *);
  63. extern void mnt_make_shortterm(struct vfsmount *);
  64. extern void __init mnt_init(void);
  65. DECLARE_BRLOCK(vfsmount_lock);
  66. /*
  67. * fs_struct.c
  68. */
  69. extern void chroot_fs_refs(struct path *, struct path *);
  70. /*
  71. * file_table.c
  72. */
  73. extern void file_sb_list_add(struct file *f, struct super_block *sb);
  74. extern void file_sb_list_del(struct file *f);
  75. extern void mark_files_ro(struct super_block *);
  76. extern struct file *get_empty_filp(void);
  77. /*
  78. * super.c
  79. */
  80. extern int do_remount_sb(struct super_block *, int, void *, int);
  81. extern void __put_super(struct super_block *sb);
  82. extern void put_super(struct super_block *sb);
  83. extern struct dentry *mount_fs(struct file_system_type *,
  84. int, const char *, void *);
  85. /*
  86. * open.c
  87. */
  88. struct nameidata;
  89. extern struct file *nameidata_to_filp(struct nameidata *);
  90. extern void release_open_intent(struct nameidata *);
  91. struct open_flags {
  92. int open_flag;
  93. int mode;
  94. int acc_mode;
  95. int intent;
  96. };
  97. extern struct file *do_filp_open(int dfd, const char *pathname,
  98. const struct open_flags *op, int lookup_flags);
  99. extern struct file *do_file_open_root(struct dentry *, struct vfsmount *,
  100. const char *, const struct open_flags *, int lookup_flags);
  101. extern long do_handle_open(int mountdirfd,
  102. struct file_handle __user *ufh, int open_flag);
  103. /*
  104. * inode.c
  105. */
  106. extern spinlock_t inode_sb_list_lock;
  107. /*
  108. * fs-writeback.c
  109. */
  110. extern void inode_wb_list_del(struct inode *inode);
  111. extern int get_nr_dirty_inodes(void);
  112. extern void evict_inodes(struct super_block *);
  113. extern int invalidate_inodes(struct super_block *, bool);