1 /* Copyright © 2017-2018 Apple Inc. All rights reserved.
6 * Created by Yakov Ben Zaken on 20/03/2018.
9 #ifndef lf_hfs_vfsutils_h
10 #define lf_hfs_vfsutils_h
14 u_int32_t
BestBlockSizeFit(u_int32_t allocationBlockSize
, u_int32_t blockSizeLimit
, u_int32_t baseMultiple
);
15 int hfs_MountHFSPlusVolume(struct hfsmount
*hfsmp
, HFSPlusVolumeHeader
*vhp
, off_t embeddedOffset
, u_int64_t disksize
, bool bFailForDirty
);
16 int hfs_CollectBtreeStats(struct hfsmount
*hfsmp
, HFSPlusVolumeHeader
*vhp
, off_t embeddedOffset
, void *args
);
17 int hfs_ValidateHFSPlusVolumeHeader(struct hfsmount
*hfsmp
, HFSPlusVolumeHeader
*vhp
);
18 int hfs_start_transaction(struct hfsmount
*hfsmp
);
19 int hfs_end_transaction(struct hfsmount
*hfsmp
);
20 void* hfs_malloc( size_t size
);
21 void hfs_free( void* ptr
);
22 void* hfs_mallocz( size_t size
);
23 int hfsUnmount( register struct hfsmount
*hfsmp
);
24 void hfs_lock_mount(struct hfsmount
*hfsmp
);
25 void hfs_unlock_mount(struct hfsmount
*hfsmp
);
26 int hfs_systemfile_lock(struct hfsmount
*hfsmp
, int flags
, enum hfs_locktype locktype
);
27 void hfs_systemfile_unlock(struct hfsmount
*hfsmp
, int flags
);
28 u_int32_t
hfs_freeblks(struct hfsmount
* hfsmp
, int wantreserve
);
29 short MacToVFSError(OSErr err
);
31 void hfs_reldirhint(struct cnode
*dcp
, directoryhint_t
* relhint
);
32 void hfs_insertdirhint(struct cnode
*dcp
, directoryhint_t
* hint
);
33 void hfs_reldirhints(struct cnode
*dcp
, int stale_hints_only
);
35 directoryhint_t
* hfs_getdirhint(struct cnode
*dcp
, int index
, int detach
);
37 int hfs_systemfile_lock(struct hfsmount
*hfsmp
, int flags
, enum hfs_locktype locktype
);
38 void hfs_systemfile_unlock(struct hfsmount
*hfsmp
, int flags
);
39 bool overflow_extents(struct filefork
*fp
);
40 int hfs_namecmp(const u_int8_t
*str1
, size_t len1
, const u_int8_t
*str2
, size_t len2
);
41 int hfs_strstr(const u_int8_t
*str1
, size_t len1
, const u_int8_t
*str2
, size_t len2
);
42 int hfs_apendixcmp(const u_int8_t
*str1
, size_t len1
, const u_int8_t
*str2
, size_t len2
);
43 void hfs_remove_orphans(struct hfsmount
* hfsmp
);
44 int hfs_erase_unused_nodes(struct hfsmount
*hfsmp
);
46 int hfs_lock_global (struct hfsmount
*hfsmp
, enum hfs_locktype locktype
);
47 void hfs_unlock_global (struct hfsmount
*hfsmp
);
51 int hfs_early_journal_init(struct hfsmount
*hfsmp
, HFSPlusVolumeHeader
*vhp
,
52 void *_args
, off_t embeddedOffset
, daddr64_t mdb_offset
,
53 HFSMasterDirectoryBlock
*mdbp
);
54 errno_t
hfs_flush(struct hfsmount
*hfsmp
, hfs_flush_mode_t mode
);
56 #endif /* lf_hfs_vfsutils_h */