]> git.saurik.com Git - apple/hfs.git/blame_incremental - livefiles_hfs_plugin/lf_hfs_vfsutils.h
hfs-522.100.5.tar.gz
[apple/hfs.git] / livefiles_hfs_plugin / lf_hfs_vfsutils.h
... / ...
CommitLineData
1/* Copyright © 2017-2018 Apple Inc. All rights reserved.
2 *
3 * lf_hfs_vfsutils.h
4 * livefiles_hfs
5 *
6 * Created by Yakov Ben Zaken on 20/03/2018.
7 */
8
9#ifndef lf_hfs_vfsutils_h
10#define lf_hfs_vfsutils_h
11
12#include "lf_hfs.h"
13
14u_int32_t BestBlockSizeFit(u_int32_t allocationBlockSize, u_int32_t blockSizeLimit, u_int32_t baseMultiple);
15int hfs_MountHFSPlusVolume(struct hfsmount *hfsmp, HFSPlusVolumeHeader *vhp, off_t embeddedOffset, u_int64_t disksize, bool bFailForDirty);
16int hfs_CollectBtreeStats(struct hfsmount *hfsmp, HFSPlusVolumeHeader *vhp, off_t embeddedOffset, void *args);
17int hfs_ValidateHFSPlusVolumeHeader(struct hfsmount *hfsmp, HFSPlusVolumeHeader *vhp);
18int hfs_start_transaction(struct hfsmount *hfsmp);
19int hfs_end_transaction(struct hfsmount *hfsmp);
20void* hfs_malloc( size_t size );
21void hfs_free( void* ptr );
22void* hfs_mallocz( size_t size);
23int hfsUnmount( register struct hfsmount *hfsmp);
24void hfs_lock_mount(struct hfsmount *hfsmp);
25void hfs_unlock_mount(struct hfsmount *hfsmp);
26int hfs_systemfile_lock(struct hfsmount *hfsmp, int flags, enum hfs_locktype locktype);
27void hfs_systemfile_unlock(struct hfsmount *hfsmp, int flags);
28u_int32_t hfs_freeblks(struct hfsmount * hfsmp, int wantreserve);
29short MacToVFSError(OSErr err);
30
31void hfs_reldirhint(struct cnode *dcp, directoryhint_t * relhint);
32void hfs_insertdirhint(struct cnode *dcp, directoryhint_t * hint);
33void hfs_reldirhints(struct cnode *dcp, int stale_hints_only);
34
35directoryhint_t* hfs_getdirhint(struct cnode *dcp, int index, int detach);
36
37int hfs_systemfile_lock(struct hfsmount *hfsmp, int flags, enum hfs_locktype locktype);
38void hfs_systemfile_unlock(struct hfsmount *hfsmp, int flags);
39bool overflow_extents(struct filefork *fp);
40int hfs_namecmp(const u_int8_t *str1, size_t len1, const u_int8_t *str2, size_t len2);
41int hfs_strstr(const u_int8_t *str1, size_t len1, const u_int8_t *str2, size_t len2);
42int hfs_apendixcmp(const u_int8_t *str1, size_t len1, const u_int8_t *str2, size_t len2);
43void hfs_remove_orphans(struct hfsmount * hfsmp);
44int hfs_erase_unused_nodes(struct hfsmount *hfsmp);
45
46int hfs_lock_global (struct hfsmount *hfsmp, enum hfs_locktype locktype);
47void hfs_unlock_global (struct hfsmount *hfsmp);
48
49
50// Journaing
51int hfs_early_journal_init(struct hfsmount *hfsmp, HFSPlusVolumeHeader *vhp,
52 void *_args, off_t embeddedOffset, daddr64_t mdb_offset,
53 HFSMasterDirectoryBlock *mdbp);
54errno_t hfs_flush(struct hfsmount *hfsmp, hfs_flush_mode_t mode);
55
56#endif /* lf_hfs_vfsutils_h */