internal.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
  55. extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
  56. struct vfsmount *);
  57. extern void release_mounts(struct list_head *);
  58. extern void umount_tree(struct vfsmount *, int, struct list_head *);
  59. extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
  60. extern void __init mnt_init(void);
  61. DECLARE_BRLOCK(vfsmount_lock);
  62. /*
  63. * fs_struct.c
  64. */
  65. extern void chroot_fs_refs(struct path *, struct path *);
  66. /*
  67. * file_table.c
  68. */
  69. extern void file_sb_list_add(struct file *f, struct super_block *sb);
  70. extern void file_sb_list_del(struct file *f);
  71. extern void mark_files_ro(struct super_block *);
  72. extern struct file *get_empty_filp(void);
  73. /*
  74. * super.c
  75. */
  76. extern int do_remount_sb(struct super_block *, int, void *, int);
  77. extern void __put_super(struct super_block *sb);
  78. extern void put_super(struct super_block *sb);
  79. /*
  80. * open.c
  81. */
  82. struct nameidata;
  83. extern struct file *nameidata_to_filp(struct nameidata *);
  84. extern void release_open_intent(struct nameidata *);