ext2fs_extern.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* $OpenBSD: ext2fs_extern.h,v 1.35 2014/07/14 08:54:13 pelikan Exp $ */
  2. /* $NetBSD: ext2fs_extern.h,v 1.1 1997/06/11 09:33:55 bouyer Exp $ */
  3. /*-
  4. * Copyright (c) 1997 Manuel Bouyer.
  5. * Copyright (c) 1991, 1993, 1994
  6. * The Regents of the University of California. All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. Neither the name of the University nor the names of its contributors
  17. * may be used to endorse or promote products derived from this software
  18. * without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  21. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  24. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94
  33. * Modified for ext2fs by Manuel Bouyer.
  34. */
  35. struct buf;
  36. struct fid;
  37. struct m_ext2fs;
  38. struct inode;
  39. struct mount;
  40. struct nameidata;
  41. struct proc;
  42. struct statfs;
  43. struct timeval;
  44. struct ucred;
  45. struct ufsmount;
  46. struct uio;
  47. struct vnode;
  48. struct vfsconf;
  49. struct mbuf;
  50. struct componentname;
  51. extern struct pool ext2fs_inode_pool; /* memory pool for inodes */
  52. extern struct pool ext2fs_dinode_pool; /* memory pool for dinodes */
  53. __BEGIN_DECLS
  54. /* ext2fs_alloc.c */
  55. int ext2fs_alloc(struct inode *, u_int32_t, u_int32_t , struct ucred *,
  56. u_int32_t *);
  57. int ext2fs_inode_alloc(struct inode *, mode_t mode, struct ucred *,
  58. struct vnode **);
  59. daddr_t ext2fs_blkpref(struct inode *, u_int32_t, int, u_int32_t *);
  60. void ext2fs_blkfree(struct inode *, u_int32_t);
  61. void ext2fs_inode_free(struct inode *, ufsino_t, mode_t);
  62. /* ext2fs_balloc.c */
  63. int ext2fs_buf_alloc(struct inode *, u_int32_t, int, struct ucred *,
  64. struct buf **, int);
  65. /* ext2fs_bmap.c */
  66. int ext2fs_bmap(void *);
  67. /* ext2fs_inode.c */
  68. u_int64_t ext2fs_size(struct inode *);
  69. int ext2fs_init(struct vfsconf *);
  70. int ext2fs_setsize(struct inode *, u_int64_t);
  71. int ext2fs_update(struct inode *ip, int waitfor);
  72. int ext2fs_truncate(struct inode *, off_t, int, struct ucred *);
  73. int ext2fs_inactive(void *);
  74. /* ext2fs_lookup.c */
  75. int ext2fs_readdir(void *);
  76. int ext2fs_lookup(void *);
  77. int ext2fs_direnter(struct inode *, struct vnode *, struct componentname *);
  78. int ext2fs_dirremove(struct vnode *, struct componentname *);
  79. int ext2fs_dirrewrite(struct inode *, struct inode *, struct componentname *);
  80. int ext2fs_dirempty(struct inode *, ufsino_t, struct ucred *);
  81. int ext2fs_checkpath(struct inode *, struct inode *, struct ucred *);
  82. /* ext2fs_subr.c */
  83. int ext2fs_bufatoff(struct inode *, off_t, char **, struct buf **);
  84. int ext2fs_vinit(struct mount *, struct vops *, struct vops *,
  85. struct vnode **);
  86. #ifdef DIAGNOSTIC
  87. void ext2fs_checkoverlap(struct buf *, struct inode *);
  88. #endif
  89. /* ext2fs_vfsops.c */
  90. int ext2fs_mountroot(void);
  91. int ext2fs_mount(struct mount *, const char *, void *, struct nameidata *,
  92. struct proc *);
  93. int ext2fs_reload(struct mount *, struct ucred *, struct proc *);
  94. int ext2fs_mountfs(struct vnode *, struct mount *, struct proc *);
  95. int ext2fs_unmount(struct mount *, int, struct proc *);
  96. int ext2fs_flushfiles(struct mount *, int, struct proc *);
  97. int ext2fs_statfs(struct mount *, struct statfs *, struct proc *);
  98. int ext2fs_sync(struct mount *, int, struct ucred *, struct proc *);
  99. int ext2fs_vget(struct mount *, ino_t, struct vnode **);
  100. int ext2fs_fhtovp(struct mount *, struct fid *, struct vnode **);
  101. int ext2fs_vptofh(struct vnode *, struct fid *);
  102. int ext2fs_sbupdate(struct ufsmount *, int);
  103. int ext2fs_cgupdate(struct ufsmount *, int);
  104. int ext2fs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
  105. struct proc *);
  106. /* ext2fs_readwrite.c */
  107. int ext2fs_read(void *);
  108. int ext2fs_write(void *);
  109. /* ext2fs_vnops.c */
  110. int ext2fs_create(void *);
  111. int ext2fs_mknod(void *);
  112. int ext2fs_open(void *);
  113. int ext2fs_access(void *);
  114. int ext2fs_getattr(void *);
  115. int ext2fs_setattr(void *);
  116. int ext2fs_remove(void *);
  117. int ext2fs_link(void *);
  118. int ext2fs_rename(void *);
  119. int ext2fs_mkdir(void *);
  120. int ext2fs_rmdir(void *);
  121. int ext2fs_symlink(void *);
  122. int ext2fs_readlink(void *);
  123. int ext2fs_pathconf(void *);
  124. int ext2fs_advlock(void *);
  125. int ext2fs_makeinode(int, struct vnode *, struct vnode **,
  126. struct componentname *cnp);
  127. int ext2fs_fsync(void *);
  128. int ext2fs_reclaim(void *);
  129. int ext2fsfifo_reclaim(void *);
  130. __END_DECLS
  131. #define IS_EXT2_VNODE(vp) (vp->v_tag == VT_EXT2FS)
  132. extern struct vops ext2fs_vops;
  133. extern struct vops ext2fs_specvops;
  134. #ifdef FIFO
  135. extern struct vops ext2fs_fifovops;
  136. #define EXT2FS_FIFOOPS &ext2fs_fifovops
  137. #else
  138. #define EXT2FS_FIFOOPS NULL
  139. #endif