2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
10 # $Id: pfs_types.h 577 2004-09-14 14:41:46Z pixel $
16 ///////////////////////////////////////////////////////////////////////////////
17 // Pre-processor macros
20 #define PFS_BLOCKSIZE 0x2000
21 #define PFS_SUPER_MAGIC 0x50465300 // "PFS\0" aka Playstation Filesystem
22 #define PFS_JOUNRNAL_MAGIC 0x5046534C // "PFSL" aka PFS Log
23 #define PFS_SEGD_MAGIC 0x53454744 // "SEGD" aka segment descriptor direct
24 #define PFS_SEGI_MAGIC 0x53454749 // "SEGI" aka segment descriptor indirect
25 #define PFS_MAX_SUBPARTS 64
26 #define PFS_NAME_LEN 255
29 ///////////////////////////////////////////////////////////////////////////////
34 u32 magic
; // =PFS_JOUNRNAL_MAGIC
38 u32 sector
; // block/sector for partition
39 u16 sub
; // main(0)/sub(+1) partition
40 u16 logSector
; // block/sector offset in journal area
45 u8 kLen
; // key len/used for offset in to str for value
47 u16 aLen
; // allocated length == ((kLen+vLen+7) & ~3)
48 char str
[3]; // size = 3 so sizeof pfs_aentry_t=7 :P
54 u8 pLen
; // path length
55 u16 aLen
; // allocated length == ((pLen+8+3) & ~3)
59 // Block number/count pair (used in inodes)
66 // Date/time descriptor
77 // Superblock structure
84 u32 num_subs
; // number of subs attached to filesystem
85 pfs_blockinfo log
; // block info for metadata log
86 pfs_blockinfo root
; // block info for root directory
91 u32 checksum
; // Sum of all other words in the inode
93 pfs_blockinfo inode_block
; // start block of inode
94 pfs_blockinfo next_segment
; // next segment descriptor inode
95 pfs_blockinfo last_segment
; // last segment descriptor inode
96 pfs_blockinfo unused
; //
97 pfs_blockinfo data
[114]; //
98 u16 mode
; // file mode
99 u16 attr
; // file attributes
102 pfs_datetime atime
; //
103 pfs_datetime ctime
; //
104 pfs_datetime mtime
; //
106 u32 number_blocks
; // number of blocks/zones used by file
107 u32 number_data
; // number of used entries in data array
108 u32 number_segdesg
; // number of "indirect blocks"/next segment descriptor's
109 u32 subpart
; // subpart of inode
113 #endif /* _PFS_TYPES_H */