cd9660_extern.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* $OpenBSD: cd9660_extern.h,v 1.13 2013/06/02 01:07:39 deraadt Exp $ */
  2. /* $NetBSD: cd9660_extern.h,v 1.1 1997/01/24 00:24:53 cgd 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. * @(#)iso.h 8.4 (Berkeley) 12/5/94
  37. */
  38. /*
  39. * Definitions used in the kernel for cd9660 file system support.
  40. */
  41. /* CD-ROM Format type */
  42. enum ISO_FTYPE { ISO_FTYPE_DEFAULT, ISO_FTYPE_9660, ISO_FTYPE_RRIP, ISO_FTYPE_ECMA };
  43. #ifndef ISOFSMNT_ROOT
  44. #define ISOFSMNT_ROOT 0
  45. #endif
  46. struct iso_mnt {
  47. int im_flags;
  48. struct mount *im_mountp;
  49. dev_t im_dev;
  50. struct vnode *im_devvp;
  51. int logical_block_size;
  52. int im_bshift;
  53. int im_bmask;
  54. int volume_space_size;
  55. struct netexport im_export;
  56. char root[ISODCL (157, 190)];
  57. int root_extent;
  58. int root_size;
  59. enum ISO_FTYPE iso_ftype;
  60. int rr_skip;
  61. int rr_skip0;
  62. int joliet_level;
  63. };
  64. #define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data))
  65. #define blkoff(imp, loc) ((loc) & (imp)->im_bmask)
  66. #define lblktosize(imp, blk) ((blk) << (imp)->im_bshift)
  67. #define lblkno(imp, loc) ((loc) >> (imp)->im_bshift)
  68. #define blksize(imp, ip, lbn) ((imp)->logical_block_size)
  69. int cd9660_mount(struct mount *, const char *, void *,
  70. struct nameidata *, struct proc *);
  71. int cd9660_start(struct mount *, int, struct proc *);
  72. int cd9660_unmount(struct mount *, int, struct proc *);
  73. int cd9660_root(struct mount *, struct vnode **);
  74. int cd9660_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *);
  75. int cd9660_statfs(struct mount *, struct statfs *, struct proc *);
  76. int cd9660_sync(struct mount *, int, struct ucred *, struct proc *);
  77. int cd9660_vget(struct mount *, ino_t, struct vnode **);
  78. int cd9660_fhtovp(struct mount *, struct fid *, struct vnode **);
  79. int cd9660_vptofh(struct vnode *, struct fid *);
  80. int cd9660_init(struct vfsconf *);
  81. int cd9660_check_export(struct mount *, struct mbuf *, int *,
  82. struct ucred **);
  83. #define cd9660_sysctl ((int (*)(int *, u_int, void *, size_t *, void *, \
  84. size_t, struct proc *))eopnotsupp)
  85. int cd9660_mountroot(void);
  86. extern struct vops cd9660_vops;
  87. extern struct vops cd9660_specvops;
  88. #ifdef FIFO
  89. extern struct vops cd9660_fifovops;
  90. #endif
  91. int isochar(const u_char *, const u_char *, int, u_char *);
  92. int isofncmp(const u_char *, int, const u_char *, int, int);
  93. void isofntrans(u_char *, int, u_char *, u_short *, int, int, int);
  94. cdino_t isodirino(struct iso_directory_record *, struct iso_mnt *);