cd9660_node.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* $OpenBSD: cd9660_node.h,v 1.19 2013/06/02 01:07:39 deraadt Exp $ */
  2. /* $NetBSD: cd9660_node.h,v 1.15 1997/04/11 21:52:01 kleink Exp $ */
  3. /*-
  4. * Copyright (c) 1994
  5. * The Regents of the University of California. All rights reserved.
  6. *
  7. * This code is derived from software contributed to Berkeley
  8. * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
  9. * Support code is derived from software contributed to Berkeley
  10. * by Atsushi Murai (amurai@spec.co.jp).
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. * 1. Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in the
  19. * documentation and/or other materials provided with the distribution.
  20. * 3. Neither the name of the University nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  25. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  30. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  32. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  33. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  34. * SUCH DAMAGE.
  35. *
  36. * @(#)cd9660_node.h 8.4 (Berkeley) 12/5/94
  37. */
  38. #include <sys/buf.h>
  39. #define doff_t u_quad_t
  40. typedef struct {
  41. struct timespec iso_atime; /* time of last access */
  42. struct timespec iso_mtime; /* time of last modification */
  43. struct timespec iso_ctime; /* time file changed */
  44. u_short iso_mode; /* files access mode and type */
  45. uid_t iso_uid; /* owner user id */
  46. gid_t iso_gid; /* owner group id */
  47. short iso_links; /* links of file */
  48. dev_t iso_rdev; /* Major/Minor number for special */
  49. } ISO_RRIP_INODE;
  50. struct iso_node {
  51. struct iso_node *i_next, **i_prev; /* hash chain */
  52. struct vnode *i_vnode; /* vnode associated with this inode */
  53. struct vnode *i_devvp; /* vnode for block I/O */
  54. u_int i_flag; /* see below */
  55. dev_t i_dev; /* device where inode resides */
  56. cdino_t i_number; /* the identity of the inode */
  57. /* we use the actual starting block of the file */
  58. struct iso_mnt *i_mnt; /* filesystem associated with this inode */
  59. struct lockf *i_lockf; /* head of byte-level lock list */
  60. doff_t i_endoff; /* end of useful stuff in directory */
  61. doff_t i_diroff; /* offset in dir, where we found last entry */
  62. doff_t i_offset; /* offset of free space in directory */
  63. cdino_t i_ino; /* inode number of found directory */
  64. struct lock i_lock; /* node lock */
  65. doff_t iso_extent; /* extent of file */
  66. doff_t i_size;
  67. /*
  68. * Actual start of data file (may be different from iso_extent, if the
  69. * file has extended attributes).
  70. */
  71. doff_t iso_start;
  72. ISO_RRIP_INODE inode;
  73. struct cluster_info i_ci;
  74. };
  75. #define i_forw i_chain[0]
  76. #define i_back i_chain[1]
  77. /* flags */
  78. #define IN_ACCESS 0x0020 /* inode access time to be updated */
  79. #define VTOI(vp) ((struct iso_node *)(vp)->v_data)
  80. #define ITOV(ip) ((ip)->i_vnode)
  81. /*
  82. * Prototypes for ISOFS vnode operations
  83. */
  84. int cd9660_lookup(void *);
  85. int cd9660_open(void *);
  86. int cd9660_close(void *);
  87. int cd9660_access(void *);
  88. int cd9660_getattr(void *);
  89. int cd9660_setattr(void *);
  90. int cd9660_read(void *);
  91. int cd9660_ioctl(void *);
  92. int cd9660_poll(void *);
  93. int cd9660_mmap(void *);
  94. int cd9660_seek(void *);
  95. int cd9660_readdir(void *);
  96. int cd9660_readlink(void *);
  97. int cd9660_abortop(void *);
  98. int cd9660_inactive(void *);
  99. int cd9660_reclaim(void *);
  100. int cd9660_link(void *);
  101. int cd9660_symlink(void *);
  102. int cd9660_bmap(void *);
  103. int cd9660_lock(void *);
  104. int cd9660_unlock(void *);
  105. int cd9660_strategy(void *);
  106. int cd9660_print(void *);
  107. int cd9660_islocked(void *);
  108. int cd9660_pathconf(void *);
  109. int cd9660_bufatoff(struct iso_node *, off_t, char **, struct buf **);
  110. void cd9660_defattr(struct iso_directory_record *, struct iso_node *,
  111. struct buf *);
  112. void cd9660_deftstamp(struct iso_directory_record *, struct iso_node *,
  113. struct buf *);
  114. struct vnode *cd9660_ihashget(dev_t, cdino_t);
  115. int cd9660_ihashins(struct iso_node *);
  116. void cd9660_ihashrem(struct iso_node *);
  117. int cd9660_tstamp_conv7(u_char *, struct timespec *);
  118. int cd9660_tstamp_conv17(u_char *, struct timespec *);
  119. int cd9660_vget_internal(struct mount *, cdino_t, struct vnode **, int,
  120. struct iso_directory_record *);