ntfs_subr.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* $OpenBSD: ntfs_subr.h,v 1.9 2014/01/19 18:35:45 tedu Exp $ */
  2. /* $NetBSD: ntfs_subr.h,v 1.1 2002/12/23 17:38:33 jdolecek Exp $ */
  3. /*-
  4. * Copyright (c) 1998, 1999 Semen Ustimenko
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  17. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  20. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  22. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  23. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  24. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  25. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  26. * SUCH DAMAGE.
  27. *
  28. * Id: ntfs_subr.h,v 1.4 1999/05/12 09:43:02 semenu Exp
  29. */
  30. #define VA_LOADED 0x0001
  31. #define VA_PRELOADED 0x0002
  32. struct ntvattr {
  33. LIST_ENTRY(ntvattr) va_list;
  34. u_int32_t va_vflag;
  35. struct vnode *va_vp;
  36. struct ntnode *va_ip;
  37. u_int32_t va_flag;
  38. u_int32_t va_type;
  39. u_int8_t va_namelen;
  40. char va_name[NTFS_MAXATTRNAME];
  41. u_int32_t va_compression;
  42. u_int32_t va_compressalg;
  43. u_int64_t va_datalen;
  44. u_int64_t va_allocated;
  45. cn_t va_vcnstart;
  46. cn_t va_vcnend;
  47. u_int16_t va_index;
  48. union {
  49. struct {
  50. cn_t * cn;
  51. cn_t * cl;
  52. u_long cnt;
  53. } vrun;
  54. caddr_t datap;
  55. struct attr_name *name;
  56. struct attr_indexroot *iroot;
  57. struct attr_indexalloc *ialloc;
  58. } va_d;
  59. };
  60. #define va_vruncn va_d.vrun.cn
  61. #define va_vruncl va_d.vrun.cl
  62. #define va_vruncnt va_d.vrun.cnt
  63. #define va_datap va_d.datap
  64. #define va_a_name va_d.name
  65. #define va_a_iroot va_d.iroot
  66. #define va_a_ialloc va_d.ialloc
  67. int ntfs_procfixups( struct ntfsmount *, u_int32_t, caddr_t, size_t );
  68. int ntfs_parserun( cn_t *, cn_t *, u_int8_t *, u_long, u_long *);
  69. int ntfs_runtocn( cn_t *, struct ntfsmount *, u_int8_t *, u_long, cn_t);
  70. int ntfs_readntvattr_plain( struct ntfsmount *, struct ntnode *, struct ntvattr *, off_t, size_t, void *,size_t *, struct uio *);
  71. int ntfs_readattr_plain( struct ntfsmount *, struct ntnode *, u_int32_t, char *, off_t, size_t, void *,size_t *, struct uio *);
  72. int ntfs_readattr( struct ntfsmount *, struct ntnode *, u_int32_t, char *, off_t, size_t, void *, struct uio *);
  73. int ntfs_filesize( struct ntfsmount *, struct fnode *, u_int64_t *, u_int64_t *);
  74. int ntfs_times( struct ntfsmount *, struct ntnode *, ntfs_times_t *);
  75. struct timespec ntfs_nttimetounix( u_int64_t );
  76. int ntfs_runtovrun( cn_t **, cn_t **, u_long *, u_int8_t *);
  77. int ntfs_attrtontvattr( struct ntfsmount *, struct ntvattr **, struct attr * );
  78. void ntfs_freentvattr( struct ntvattr * );
  79. int ntfs_loadntvattrs( struct ntfsmount *, struct vnode *, caddr_t, struct ntvattr **);
  80. struct ntvattr * ntfs_findntvattr( struct ntfsmount *, struct ntnode *, u_int32_t, cn_t );
  81. int ntfs_isnamepermitted(struct ntfsmount *, struct attr_indexentry * );
  82. int ntfs_ntvattrrele(struct ntvattr * );
  83. int ntfs_ntvattrget(struct ntfsmount *, struct ntnode *, u_int32_t, const char *, cn_t , struct ntvattr **);
  84. void ntfs_ntref(struct ntnode *);
  85. void ntfs_ntrele(struct ntnode *);
  86. int ntfs_loadntnode( struct ntfsmount *, struct ntnode * );
  87. int ntfs_writentvattr_plain(struct ntfsmount *, struct ntnode *, struct ntvattr *, off_t, size_t, void *, size_t *, struct uio *);
  88. int ntfs_writeattr_plain(struct ntfsmount *, struct ntnode *, u_int32_t, char *, off_t, size_t, void *, size_t *, struct uio *);
  89. int ntfs_fget(struct ntfsmount *, struct ntnode *, int, char *, struct fnode **);
  90. void ntfs_frele(struct fnode *);
  91. int ntfs_ntreaddir(struct ntfsmount *, struct fnode *, u_int32_t, struct attr_indexentry **, struct proc *);
  92. int ntfs_ntlookupfile(struct ntfsmount *, struct vnode *, struct componentname *, struct vnode **, struct proc *);
  93. int ntfs_ntlookup(struct ntfsmount *, ntfsino_t, struct ntnode **, struct proc *);
  94. int ntfs_ntget(struct ntnode *, struct proc *);
  95. void ntfs_ntput(struct ntnode *, struct proc *);
  96. int ntfs_toupper_use(struct mount *, struct ntfsmount *, struct proc *);
  97. void ntfs_toupper_unuse(struct proc *);
  98. /* ntfs_conv.c stuff */
  99. ntfs_wget_func_t ntfs_utf8_wget;
  100. ntfs_wput_func_t ntfs_utf8_wput;
  101. ntfs_wcmp_func_t ntfs_utf8_wcmp;