Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 715862 | Differences between
and this patch

Collapse All | Expand All

(-)a/fsck_hfs.tproj/dfalib/CatalogCheck.c (+1 lines)
Lines 23-28 Link Here
23
#include "Scavenger.h"
23
#include "Scavenger.h"
24
#include "DecompDataEnums.h"
24
#include "DecompDataEnums.h"
25
#include "DecompData.h"
25
#include "DecompData.h"
26
#include <sys/types.h>
26
27
27
/*
28
/*
28
 * information collected when visiting catalog records
29
 * information collected when visiting catalog records
(-)a/fsck_hfs.tproj/dfalib/SRepair.c (+1 lines)
Lines 36-41 Link Here
36
#include <unistd.h>
36
#include <unistd.h>
37
#include <sys/stat.h>
37
#include <sys/stat.h>
38
#include <stdlib.h>
38
#include <stdlib.h>
39
#include <sys/types.h>
39
#include "../cache.h"
40
#include "../cache.h"
40
41
41
enum {
42
enum {
(-)a/fsck_hfs.tproj/dfalib/Scavenger.h (-1 / +1 lines)
Lines 44-50 Link Here
44
#include <sys/kauth.h>
44
#include <sys/kauth.h>
45
#include <sys/syslimits.h>
45
#include <sys/syslimits.h>
46
#endif
46
#endif
47
#include <sys/errno.h>
47
#include <errno.h>
48
48
49
#ifdef __cplusplus
49
#ifdef __cplusplus
50
extern	"C" {
50
extern	"C" {
(-)a/fsck_hfs.tproj/fsck_hfs.c (-5 / +5 lines)
Lines 88-98 Cache_t fscache; Link Here
88
88
89
89
90
90
91
static int checkfilesys __P((char * filesys));
91
static int checkfilesys (char * filesys);
92
static int setup __P(( char *dev, int *blockDevice_fdPtr, int *canWritePtr ));
92
static int setup ( char *dev, int *blockDevice_fdPtr, int *canWritePtr );
93
static void usage __P((void));
93
static void usage (void);
94
static void getWriteAccess __P(( char *dev, int *blockDevice_fdPtr, int *canWritePtr ));
94
static void getWriteAccess ( char *dev, int *blockDevice_fdPtr, int *canWritePtr );
95
extern char *unrawname __P((char *name));
95
extern char *unrawname (char *name);
96
96
97
int
97
int
98
main(argc, argv)
98
main(argc, argv)
(-)a/fsck_hfs.tproj/fsck_hfs.h (-6 / +6 lines)
Lines 47-55 extern Cache_t fscache; Link Here
47
#define	EEXIT	8		/* Standard error exit. */
47
#define	EEXIT	8		/* Standard error exit. */
48
48
49
49
50
char	       *blockcheck __P((char *name));
50
char	       *blockcheck (char *name);
51
void		catch __P((int));
51
void		catch (int);
52
void		ckfini __P((int markclean));
52
void		ckfini (int markclean);
53
void		pfatal __P((const char *fmt, ...));
53
void		pfatal (const char *fmt, ...);
54
void		pwarn __P((const char *fmt, ...));
54
void		pwarn (const char *fmt, ...);
55
int		reply __P((char *question));
55
int		reply (char *question);
(-)a/fsck_hfs.tproj/utilities.c (-2 / +2 lines)
Lines 66-73 Link Here
66
66
67
#include "fsck_hfs.h"
67
#include "fsck_hfs.h"
68
68
69
char *rawname __P((char *name));
69
char *rawname (char *name);
70
char *unrawname __P((char *name));
70
char *unrawname (char *name);
71
71
72
72
73
int
73
int
(-)a/newfs_hfs.tproj/makehfs.c (-37 / +36 lines)
Lines 35-41 Link Here
35
#include <time.h>
35
#include <time.h>
36
#include "missing.h"
36
#include "missing.h"
37
#endif
37
#endif
38
#include <sys/errno.h>
39
#include <sys/stat.h>
38
#include <sys/stat.h>
40
#if !LINUX
39
#if !LINUX
41
#include <sys/sysctl.h>
40
#include <sys/sysctl.h>
Lines 90-151 struct filefork { Link Here
90
struct filefork	gDTDBFork, gSystemFork, gReadMeFork;
89
struct filefork	gDTDBFork, gSystemFork, gReadMeFork;
91
90
92
91
93
static void WriteMDB __P((const DriveInfo *driveInfo, HFS_MDB *mdbp));
92
static void WriteMDB (const DriveInfo *driveInfo, HFS_MDB *mdbp);
94
static void InitMDB __P((hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp));
93
static void InitMDB (hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp);
95
94
96
static void WriteVH __P((const DriveInfo *driveInfo, HFSPlusVolumeHeader *hp));
95
static void WriteVH (const DriveInfo *driveInfo, HFSPlusVolumeHeader *hp);
97
static void InitVH __P((hfsparams_t *defaults, UInt64 sectors,
96
static void InitVH (hfsparams_t *defaults, UInt64 sectors,
98
		HFSPlusVolumeHeader *header));
97
		HFSPlusVolumeHeader *header);
99
98
100
static void WriteBitmap __P((const DriveInfo *dip, UInt32 startingSector,
99
static void WriteBitmap (const DriveInfo *dip, UInt32 startingSector,
101
        UInt32 alBlksUsed, UInt8 *buffer));
100
        UInt32 alBlksUsed, UInt8 *buffer);
102
101
103
static void WriteExtentsFile __P((const DriveInfo *dip, UInt32 startingSector,
102
static void WriteExtentsFile (const DriveInfo *dip, UInt32 startingSector,
104
        const hfsparams_t *dp, HFSExtentDescriptor *bbextp, void *buffer,
103
        const hfsparams_t *dp, HFSExtentDescriptor *bbextp, void *buffer,
105
        UInt32 *bytesUsed, UInt32 *mapNodes));
104
        UInt32 *bytesUsed, UInt32 *mapNodes);
106
static void InitExtentsRoot __P((UInt16 btNodeSize, HFSExtentDescriptor *bbextp,
105
static void InitExtentsRoot (UInt16 btNodeSize, HFSExtentDescriptor *bbextp,
107
		void *buffer));
106
		void *buffer);
108
107
109
static void WriteCatalogFile __P((const DriveInfo *dip, UInt32 startingSector,
108
static void WriteCatalogFile (const DriveInfo *dip, UInt32 startingSector,
110
        const hfsparams_t *dp, HFSPlusVolumeHeader *header, void *buffer,
109
        const hfsparams_t *dp, HFSPlusVolumeHeader *header, void *buffer,
111
        UInt32 *bytesUsed, UInt32 *mapNodes));
110
        UInt32 *bytesUsed, UInt32 *mapNodes);
112
static void WriteJournalInfo(const DriveInfo *driveInfo, UInt32 startingSector,
111
static void WriteJournalInfo(const DriveInfo *driveInfo, UInt32 startingSector,
113
			     const hfsparams_t *dp, HFSPlusVolumeHeader *header,
112
			     const hfsparams_t *dp, HFSPlusVolumeHeader *header,
114
			     void *buffer);
113
			     void *buffer);
115
static void InitCatalogRoot_HFSPlus __P((const hfsparams_t *dp, const HFSPlusVolumeHeader *header, void * buffer));
114
static void InitCatalogRoot_HFSPlus (const hfsparams_t *dp, const HFSPlusVolumeHeader *header, void * buffer);
116
static void InitCatalogRoot_HFS __P((const hfsparams_t *dp, void * buffer));
115
static void InitCatalogRoot_HFS (const hfsparams_t *dp, void * buffer);
117
static void InitFirstCatalogLeaf __P((const hfsparams_t *dp, void * buffer,
116
static void InitFirstCatalogLeaf (const hfsparams_t *dp, void * buffer,
118
		int wrapper));
117
		int wrapper);
119
static void InitSecondCatalogLeaf __P((const hfsparams_t *dp, void *buffer));
118
static void InitSecondCatalogLeaf (const hfsparams_t *dp, void *buffer);
120
119
121
static void WriteDesktopDB(const hfsparams_t *dp, const DriveInfo *driveInfo,
120
static void WriteDesktopDB(const hfsparams_t *dp, const DriveInfo *driveInfo,
122
        UInt32 startingSector, void *buffer, UInt32 *mapNodes);
121
        UInt32 startingSector, void *buffer, UInt32 *mapNodes);
123
122
124
static void ClearDisk __P((const DriveInfo *driveInfo, UInt64 startingSector,
123
static void ClearDisk (const DriveInfo *driveInfo, UInt64 startingSector,
125
		UInt32 numberOfSectors));
124
		UInt32 numberOfSectors);
126
static void WriteSystemFile __P((const DriveInfo *dip, UInt32 startingSector,
125
static void WriteSystemFile (const DriveInfo *dip, UInt32 startingSector,
127
		UInt32 *filesize));
126
		UInt32 *filesize);
128
static void WriteReadMeFile __P((const DriveInfo *dip, UInt32 startingSector,
127
static void WriteReadMeFile (const DriveInfo *dip, UInt32 startingSector,
129
		UInt32 *filesize));
128
		UInt32 *filesize);
130
static void WriteMapNodes __P((const DriveInfo *driveInfo, UInt32 diskStart,
129
static void WriteMapNodes (const DriveInfo *driveInfo, UInt32 diskStart,
131
		UInt32 firstMapNode, UInt32 mapNodes, UInt16 btNodeSize, void *buffer));
130
		UInt32 firstMapNode, UInt32 mapNodes, UInt16 btNodeSize, void *buffer);
132
static void WriteBuffer __P((const DriveInfo *driveInfo, UInt64 startingSector,
131
static void WriteBuffer (const DriveInfo *driveInfo, UInt64 startingSector,
133
		UInt32 byteCount, const void *buffer));
132
		UInt32 byteCount, const void *buffer);
134
static UInt32 Largest __P((UInt32 a, UInt32 b, UInt32 c, UInt32 d ));
133
static UInt32 Largest (UInt32 a, UInt32 b, UInt32 c, UInt32 d );
135
134
136
static void MarkBitInAllocationBuffer __P((HFSPlusVolumeHeader *header,
135
static void MarkBitInAllocationBuffer (HFSPlusVolumeHeader *header,
137
		UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector));
136
		UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector);
138
137
139
#if !LINUX
138
#if !LINUX
140
static UInt32 GetDefaultEncoding();
139
static UInt32 GetDefaultEncoding();
141
#endif
140
#endif
142
141
143
static UInt32 UTCToLocal __P((UInt32 utcTime));
142
static UInt32 UTCToLocal (UInt32 utcTime);
144
143
145
static UInt32 DivideAndRoundUp __P((UInt32 numerator, UInt32 denominator));
144
static UInt32 DivideAndRoundUp (UInt32 numerator, UInt32 denominator);
146
145
147
static int ConvertUTF8toUnicode __P((const UInt8* source, UInt32 bufsize,
146
static int ConvertUTF8toUnicode (const UInt8* source, UInt32 bufsize,
148
		UniChar* unibuf, UInt16 *charcount));
147
		UniChar* unibuf, UInt16 *charcount);
149
148
150
static int getencodinghint(unsigned char *name);
149
static int getencodinghint(unsigned char *name);
151
150
(-)a/newfs_hfs.tproj/newfs_hfs.c (-13 / +13 lines)
Lines 61-79 Link Here
61
61
62
#define ROUNDUP(x,y) (((x)+(y)-1)/(y)*(y))
62
#define ROUNDUP(x,y) (((x)+(y)-1)/(y)*(y))
63
63
64
static void getnodeopts __P((char* optlist));
64
static void getnodeopts (char* optlist);
65
static void getclumpopts __P((char* optlist));
65
static void getclumpopts (char* optlist);
66
static gid_t a_gid __P((char *));
66
static gid_t a_gid (char *);
67
static uid_t a_uid __P((char *));
67
static uid_t a_uid (char *);
68
static mode_t a_mask __P((char *));
68
static mode_t a_mask (char *);
69
static int hfs_newfs __P((char *device, int forceHFS, int isRaw));
69
static int hfs_newfs (char *device, int forceHFS, int isRaw);
70
static void validate_hfsplus_block_size __P((UInt64 sectorCount, UInt32 sectorSize));
70
static void validate_hfsplus_block_size (UInt64 sectorCount, UInt32 sectorSize);
71
static void hfsplus_params __P((UInt64 sectorCount, UInt32 sectorSize, hfsparams_t *defaults));
71
static void hfsplus_params (UInt64 sectorCount, UInt32 sectorSize, hfsparams_t *defaults);
72
static void hfs_params __P((UInt32 sectorCount, UInt32 sectorSize, hfsparams_t *defaults));
72
static void hfs_params (UInt32 sectorCount, UInt32 sectorSize, hfsparams_t *defaults);
73
static UInt32 clumpsizecalc __P((UInt32 clumpblocks));
73
static UInt32 clumpsizecalc (UInt32 clumpblocks);
74
static UInt32 CalcBTreeClumpSize __P((UInt32 blockSize, UInt32 nodeSize, UInt32 driveBlocks, int catalog));
74
static UInt32 CalcBTreeClumpSize (UInt32 blockSize, UInt32 nodeSize, UInt32 driveBlocks, int catalog);
75
static UInt32 CalcHFSPlusBTreeClumpSize __P((UInt32 blockSize, UInt32 nodeSize, UInt64 sectors, int catalog));
75
static UInt32 CalcHFSPlusBTreeClumpSize (UInt32 blockSize, UInt32 nodeSize, UInt64 sectors, int catalog);
76
static void usage __P((void));
76
static void usage (void);
77
77
78
78
79
char	*progname;
79
char	*progname;

Return to bug 715862