udfdecl.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:8k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #ifndef __UDF_DECL_H
  2. #define __UDF_DECL_H
  3. #include <linux/udf_167.h>
  4. #include <linux/udf_udf.h>
  5. #include "udfend.h"
  6. #include <linux/udf_fs.h>
  7. #ifdef __KERNEL__
  8. #include <linux/config.h>
  9. #include <linux/types.h>
  10. #include <linux/fs.h>
  11. #if !defined(CONFIG_UDF_FS) && !defined(CONFIG_UDF_FS_MODULE)
  12. #define CONFIG_UDF_FS_MODULE
  13. #include <linux/udf_fs_sb.h>
  14. #include <linux/udf_fs_i.h>
  15. #endif
  16. #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
  17. #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )
  18. #define CURRENT_UTIME (xtime.tv_usec)
  19. #define udf_file_entry_alloc_offset(inode)
  20. ((UDF_I_EXTENDED_FE(inode) ?
  21. sizeof(struct ExtendedFileEntry) :
  22. sizeof(struct FileEntry)) + UDF_I_LENEATTR(inode))
  23. #define udf_ext0_offset(inode)
  24. (UDF_I_ALLOCTYPE(inode) == ICB_FLAG_AD_IN_ICB ?
  25. udf_file_entry_alloc_offset(inode) : 0)
  26. #define udf_get_lb_pblock(sb,loc,offset) udf_get_pblock((sb), (loc).logicalBlockNum, (loc).partitionReferenceNum, (offset))
  27. #else
  28. #include <sys/types.h>
  29. #endif /* __KERNEL__ */
  30. #ifdef __KERNEL__
  31. struct dentry;
  32. struct inode;
  33. struct task_struct;
  34. struct buffer_head;
  35. struct super_block;
  36. extern struct inode_operations udf_dir_inode_operations;
  37. extern struct file_operations udf_dir_operations;
  38. extern struct inode_operations udf_file_inode_operations;
  39. extern struct file_operations udf_file_operations;
  40. extern struct address_space_operations udf_aops;
  41. extern struct address_space_operations udf_adinicb_aops;
  42. extern struct address_space_operations udf_symlink_aops;
  43. struct udf_fileident_bh
  44. {
  45. struct buffer_head *sbh;
  46. struct buffer_head *ebh;
  47. int soffset;
  48. int eoffset;
  49. };
  50. #endif /* __KERNEL__ */
  51. struct udf_directory_record
  52. {
  53. Uint32 d_parent;
  54. Uint32 d_inode;
  55. Uint32 d_name[255];
  56. };
  57. struct udf_vds_record
  58. {
  59. Uint32 block;
  60. Uint32 volDescSeqNum;
  61. };
  62. struct ktm
  63. {
  64. int tm_sec;
  65. int tm_min;
  66. int tm_hour;
  67. int tm_mday;
  68. int tm_mon;
  69. int tm_year;
  70. int tm_isdst;
  71. };
  72. struct ustr
  73. {
  74. Uint8 u_cmpID;
  75. Uint8 u_name[UDF_NAME_LEN];
  76. Uint8 u_len;
  77. Uint8 padding;
  78. unsigned long u_hash;
  79. };
  80. #ifdef __KERNEL__
  81. /* super.c */
  82. extern void udf_error(struct super_block *, const char *, const char *, ...);
  83. extern void udf_warning(struct super_block *, const char *, const char *, ...);
  84. /* namei.c */
  85. extern int udf_write_fi(struct inode *inode, struct FileIdentDesc *, struct FileIdentDesc *, struct udf_fileident_bh *, Uint8 *, Uint8 *);
  86. /* file.c */
  87. extern int udf_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
  88. /* inode.c */
  89. extern struct inode *udf_iget(struct super_block *, lb_addr);
  90. extern int udf_sync_inode(struct inode *);
  91. extern void udf_expand_file_adinicb(struct inode *, int, int *);
  92. extern struct buffer_head * udf_expand_dir_adinicb(struct inode *, int *, int *);
  93. extern struct buffer_head * udf_getblk(struct inode *, long, int, int *);
  94. extern struct buffer_head * udf_bread(struct inode *, int, int, int *);
  95. extern void udf_truncate(struct inode *);
  96. extern void udf_read_inode(struct inode *);
  97. extern void udf_put_inode(struct inode *);
  98. extern void udf_delete_inode(struct inode *);
  99. extern void udf_write_inode(struct inode *, int);
  100. extern long udf_block_map(struct inode *, long);
  101. extern Sint8 inode_bmap(struct inode *, int, lb_addr *, Uint32 *, lb_addr *, Uint32 *, Uint32 *, struct buffer_head **);
  102. extern Sint8 udf_add_aext(struct inode *, lb_addr *, int *, lb_addr, Uint32, struct buffer_head **, int);
  103. extern Sint8 udf_write_aext(struct inode *, lb_addr, int *, lb_addr, Uint32, struct buffer_head *, int);
  104. extern Sint8 udf_insert_aext(struct inode *, lb_addr, int, lb_addr, Uint32, struct buffer_head *);
  105. extern Sint8 udf_delete_aext(struct inode *, lb_addr, int, lb_addr, Uint32, struct buffer_head *);
  106. extern Sint8 udf_next_aext(struct inode *, lb_addr *, int *, lb_addr *, Uint32 *, struct buffer_head **, int);
  107. extern Sint8 udf_current_aext(struct inode *, lb_addr *, int *, lb_addr *, Uint32 *, struct buffer_head **, int);
  108. extern void udf_discard_prealloc(struct inode *);
  109. /* misc.c */
  110. extern int udf_read_tagged_data(char *, int size, int fd, int block, int partref);
  111. extern struct buffer_head *udf_tgetblk(struct super_block *, int);
  112. extern struct buffer_head *udf_tread(struct super_block *, int);
  113. extern struct GenericAttrFormat *udf_add_extendedattr(struct inode *, Uint32, Uint32, Uint8, struct buffer_head **);
  114. extern struct GenericAttrFormat *udf_get_extendedattr(struct inode *, Uint32, Uint8, struct buffer_head **);
  115. extern struct buffer_head *udf_read_tagged(struct super_block *, Uint32, Uint32, Uint16 *);
  116. extern struct buffer_head *udf_read_ptagged(struct super_block *, lb_addr, Uint32, Uint16 *);
  117. extern struct buffer_head *udf_read_untagged(struct super_block *, Uint32, Uint32);
  118. extern void udf_release_data(struct buffer_head *);
  119. /* lowlevel.c */
  120. extern unsigned int udf_get_last_session(struct super_block *);
  121. extern unsigned long udf_get_last_block(struct super_block *);
  122. /* partition.c */
  123. extern Uint32 udf_get_pblock(struct super_block *, Uint32, Uint16, Uint32);
  124. extern Uint32 udf_get_pblock_virt15(struct super_block *, Uint32, Uint16, Uint32);
  125. extern Uint32 udf_get_pblock_virt20(struct super_block *, Uint32, Uint16, Uint32);
  126. extern Uint32 udf_get_pblock_spar15(struct super_block *, Uint32, Uint16, Uint32);
  127. extern int udf_relocate_blocks(struct super_block *, long, long *);
  128. /* unicode.c */
  129. extern int udf_get_filename(struct super_block *, Uint8 *, Uint8 *, int);
  130. /* ialloc.c */
  131. extern void udf_free_inode(struct inode *);
  132. extern struct inode * udf_new_inode (struct inode *, int, int *);
  133. /* truncate.c */
  134. extern void udf_truncate_extents(struct inode *);
  135. /* balloc.c */
  136. extern void udf_free_blocks(struct super_block *, struct inode *, lb_addr, Uint32, Uint32);
  137. extern int udf_prealloc_blocks(struct super_block *, struct inode *, Uint16, Uint32, Uint32);
  138. extern int udf_new_block(struct super_block *, struct inode *, Uint16, Uint32, int *);
  139. /* fsync.c */
  140. extern int udf_fsync_file(struct file *, struct dentry *, int);
  141. extern int udf_fsync_inode(struct inode *, int);
  142. /* directory.c */
  143. extern Uint8 * udf_filead_read(struct inode *, Uint8 *, Uint8, lb_addr, int *, int *, struct buffer_head **, int *);
  144. extern struct FileIdentDesc * udf_fileident_read(struct inode *, loff_t *, struct udf_fileident_bh *, struct FileIdentDesc *, lb_addr *, Uint32 *, lb_addr *, Uint32 *, Uint32 *, struct buffer_head **);
  145. #endif /* __KERNEL__ */
  146. /* Miscellaneous UDF Prototypes */
  147. /* unicode.c */
  148. extern int udf_ustr_to_dchars(Uint8 *, const struct ustr *, int);
  149. extern int udf_ustr_to_char(Uint8 *, const struct ustr *, int);
  150. extern int udf_ustr_to_dstring(dstring *, const struct ustr *, int);
  151. extern int udf_dchars_to_ustr(struct ustr *, const Uint8 *, int);
  152. extern int udf_char_to_ustr(struct ustr *, const Uint8 *, int);
  153. extern int udf_dstring_to_ustr(struct ustr *, const dstring *, int);
  154. extern int udf_translate_to_linux(Uint8 *, Uint8 *, int, Uint8 *, int);
  155. extern int udf_build_ustr(struct ustr *, dstring *, int);
  156. extern int udf_build_ustr_exact(struct ustr *, dstring *, int);
  157. extern int udf_CS0toUTF8(struct ustr *, struct ustr *);
  158. extern int udf_UTF8toCS0(dstring *, struct ustr *, int);
  159. #ifdef __KERNEL__
  160. extern int udf_CS0toNLS(struct nls_table *, struct ustr *, struct ustr *);
  161. extern int udf_NLStoCS0(struct nls_table *, dstring *, struct ustr *, int);
  162. #endif
  163. /* crc.c */
  164. extern Uint16 udf_crc(Uint8 *, Uint32, Uint16);
  165. /* misc.c */
  166. extern Uint32 udf64_low32(Uint64);
  167. extern Uint32 udf64_high32(Uint64);
  168. extern void udf_update_tag(char *, int);
  169. extern void udf_new_tag(char *, Uint16, Uint16, Uint16, Uint32, int);
  170. /* udftime.c */
  171. extern time_t *udf_stamp_to_time(time_t *, long *, timestamp);
  172. extern timestamp *udf_time_to_stamp(timestamp *, time_t, long);
  173. extern time_t udf_converttime (struct ktm *);
  174. /* directory.c */
  175. extern struct FileIdentDesc * udf_get_fileident(void * buffer, int bufsize, int * offset);
  176. extern extent_ad * udf_get_fileextent(void * buffer, int bufsize, int * offset);
  177. extern long_ad * udf_get_filelongad(void * buffer, int bufsize, int * offset, int);
  178. extern short_ad * udf_get_fileshortad(void * buffer, int bufsize, int * offset, int);
  179. extern Uint8 * udf_get_filead(struct FileEntry *, Uint8 *, int, int, int, int *);
  180. #endif /* __UDF_DECL_H */