Import 2.3.25pre1
[davej-history.git] / include / linux / ufs_fs.h
blobd938298a3c11ffb1e54c9a9a04508fd2e55ca65c
1 /*
2 * linux/include/linux/ufs_fs.h
4 * Copyright (C) 1996
5 * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
6 * Laboratory for Computer Science Research Computing Facility
7 * Rutgers, The State University of New Jersey
9 * Clean swab support by Fare <fare@tunes.org>
10 * just hope no one is using NNUUXXI on __?64 structure elements
11 * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl>
13 * 4.4BSD (FreeBSD) support added on February 1st 1998 by
14 * Niels Kristian Bech Jensen <nkbj@image.dk> partially based
15 * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
17 * NeXTstep support added on February 5th 1998 by
18 * Niels Kristian Bech Jensen <nkbj@image.dk>.
20 * Write support by Daniel Pirkl <daniel.pirkl@email.cz>
23 #ifndef __LINUX_UFS_FS_H
24 #define __LINUX_UFS_FS_H
26 #include <linux/types.h>
27 #include <linux/kernel.h>
28 #include <linux/time.h>
29 #include <linux/stat.h>
31 #define UFS_BBLOCK 0
32 #define UFS_BBSIZE 8192
33 #define UFS_SBLOCK 8192
34 #define UFS_SBSIZE 8192
36 #define UFS_SECTOR_SIZE 512
37 #define UFS_SECTOR_BITS 9
38 #define UFS_MAGIC 0x00011954
39 #define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */
41 #define UFS_BSIZE 8192
42 #define UFS_MINBSIZE 4096
43 #define UFS_FSIZE 1024
44 #define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE)
46 #define UFS_NDADDR 12
47 #define UFS_NINDIR 3
49 #define UFS_IND_BLOCK (UFS_NDADDR + 0)
50 #define UFS_DIND_BLOCK (UFS_NDADDR + 1)
51 #define UFS_TIND_BLOCK (UFS_NDADDR + 2)
53 #define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift)
54 #define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift)
55 #define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift)
56 #define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift)
58 #define UFS_ROOTINO 2
59 #define UFS_FIRST_INO (UFS_ROOTINO + 1)
61 #define UFS_USEEFT ((__u16)65535)
63 #define UFS_FSOK 0x7c269d38
64 #define UFS_FSACTIVE ((char)0x00)
65 #define UFS_FSCLEAN ((char)0x01)
66 #define UFS_FSSTABLE ((char)0x02)
67 #define UFS_FSOSF1 ((char)0x03) /* is this correct for DEC OSF/1? */
68 #define UFS_FSBAD ((char)0xff)
70 /* From here to next blank line, s_flags for ufs_sb_info */
71 /* endianness */
72 #define UFS_BYTESEX 0x00000001 /* mask; leave room to 0xF */
73 #if defined(__LITTLE_ENDIAN) || defined(__BIG_ENDIAN)
74 /* these are for sane architectures */
75 #define UFS_NATIVE_ENDIAN 0x00000000
76 #define UFS_SWABBED_ENDIAN 0x00000001
77 #else
78 /* these are for pervert architectures */
79 #define UFS_LITTLE_ENDIAN 0x00000000
80 #define UFS_BIG_ENDIAN 0x00000001
81 #endif
82 /* directory entry encoding */
83 #define UFS_DE_MASK 0x00000010 /* mask for the following */
84 #define UFS_DE_OLD 0x00000000
85 #define UFS_DE_44BSD 0x00000010
86 /* uid encoding */
87 #define UFS_UID_MASK 0x00000060 /* mask for the following */
88 #define UFS_UID_OLD 0x00000000
89 #define UFS_UID_44BSD 0x00000020
90 #define UFS_UID_EFT 0x00000040
91 /* superblock state encoding */
92 #define UFS_ST_MASK 0x00000700 /* mask for the following */
93 #define UFS_ST_OLD 0x00000000
94 #define UFS_ST_44BSD 0x00000100
95 #define UFS_ST_SUN 0x00000200
96 #define UFS_ST_SUNx86 0x00000400
97 /*cylinder group encoding */
98 #define UFS_CG_MASK 0x00003000 /* mask for the following */
99 #define UFS_CG_OLD 0x00000000
100 #define UFS_CG_44BSD 0x00002000
101 #define UFS_CG_SUN 0x00001000
103 /* fs_inodefmt options */
104 #define UFS_42INODEFMT -1
105 #define UFS_44INODEFMT 2
107 /* mount options */
108 #define UFS_MOUNT_ONERROR 0x0000000F
109 #define UFS_MOUNT_ONERROR_PANIC 0x00000001
110 #define UFS_MOUNT_ONERROR_LOCK 0x00000002
111 #define UFS_MOUNT_ONERROR_UMOUNT 0x00000004
112 #define UFS_MOUNT_ONERROR_REPAIR 0x00000008
114 #define UFS_MOUNT_UFSTYPE 0x000007F0
115 #define UFS_MOUNT_UFSTYPE_OLD 0x00000010
116 #define UFS_MOUNT_UFSTYPE_44BSD 0x00000020
117 #define UFS_MOUNT_UFSTYPE_SUN 0x00000040
118 #define UFS_MOUNT_UFSTYPE_NEXTSTEP 0x00000080
119 #define UFS_MOUNT_UFSTYPE_NEXTSTEP_CD 0x00000100
120 #define UFS_MOUNT_UFSTYPE_OPENSTEP 0x00000200
121 #define UFS_MOUNT_UFSTYPE_SUNx86 0x00000400
123 #define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt
124 #define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt
125 #define ufs_test_opt(o,opt) ((o) & UFS_MOUNT_##opt)
128 * MINFREE gives the minimum acceptable percentage of file system
129 * blocks which may be free. If the freelist drops below this level
130 * only the superuser may continue to allocate blocks. This may
131 * be set to 0 if no reserve of free blocks is deemed necessary,
132 * however throughput drops by fifty percent if the file system
133 * is run at between 95% and 100% full; thus the minimum default
134 * value of fs_minfree is 5%. However, to get good clustering
135 * performance, 10% is a better choice. hence we use 10% as our
136 * default value. With 10% free space, fragmentation is not a
137 * problem, so we choose to optimize for time.
139 #define UFS_MINFREE 5
140 #define UFS_DEFAULTOPT UFS_OPTTIME
143 * Turn file system block numbers into disk block addresses.
144 * This maps file system blocks to device size blocks.
146 #define ufs_fsbtodb(uspi, b) ((b) << (uspi)->s_fsbtodb)
147 #define ufs_dbtofsb(uspi, b) ((b) >> (uspi)->s_fsbtodb)
150 * Cylinder group macros to locate things in cylinder groups.
151 * They calc file system addresses of cylinder group data structures.
153 #define ufs_cgbase(c) (uspi->s_fpg * (c))
154 #define ufs_cgstart(c) (ufs_cgbase(c) + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask))
155 #define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno) /* super blk */
156 #define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno) /* cg block */
157 #define ufs_cgimin(c) (ufs_cgstart(c) + uspi->s_iblkno) /* inode blk */
158 #define ufs_cgdmin(c) (ufs_cgstart(c) + uspi->s_dblkno) /* 1st data */
161 * Macros for handling inode numbers:
162 * inode number to file system block offset.
163 * inode number to cylinder group number.
164 * inode number to file system block address.
166 #define ufs_inotocg(x) ((x) / uspi->s_ipg)
167 #define ufs_inotocgoff(x) ((x) % uspi->s_ipg)
168 #define ufs_inotofsba(x) (ufs_cgimin(ufs_inotocg(x)) + ufs_inotocgoff(x) / uspi->s_inopf)
169 #define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
172 * Give cylinder group number for a file system block.
173 * Give cylinder group block number for a file system block.
175 #define ufs_dtog(d) ((d) / uspi->s_fpg)
176 #define ufs_dtogd(d) ((d) % uspi->s_fpg)
179 * Compute the cylinder and rotational position of a cyl block addr.
181 #define ufs_cbtocylno(bno) \
182 ((bno) * uspi->s_nspf / uspi->s_spc)
183 #define ufs_cbtorpos(bno) \
184 ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
185 * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
186 % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
187 * uspi->s_nrpos) / uspi->s_npsect)
190 * The following macros optimize certain frequently calculated
191 * quantities by using shifts and masks in place of divisions
192 * modulos and multiplications.
194 #define ufs_blkoff(loc) ((loc) & uspi->s_qbmask)
195 #define ufs_fragoff(loc) ((loc) & uspi->s_qfmask)
196 #define ufs_lblktosize(blk) ((blk) << uspi->s_bshift)
197 #define ufs_lblkno(loc) ((loc) >> uspi->s_bshift)
198 #define ufs_numfrags(loc) ((loc) >> uspi->s_fshift)
199 #define ufs_blkroundup(size) (((size) + uspi->s_qbmask) & uspi->s_bmask)
200 #define ufs_fragroundup(size) (((size) + uspi->s_qfmask) & uspi->s_fmask)
201 #define ufs_fragstoblks(frags) ((frags) >> uspi->s_fpbshift)
202 #define ufs_blkstofrags(blks) ((blks) << uspi->s_fpbshift)
203 #define ufs_fragnum(fsb) ((fsb) & uspi->s_fpbmask)
204 #define ufs_blknum(fsb) ((fsb) & ~uspi->s_fpbmask)
206 #define UFS_MAXNAMLEN 255
207 #define UFS_MAXMNTLEN 512
208 #define UFS_MAXCSBUFS 31
209 #define UFS_LINK_MAX 32000
212 * UFS_DIR_PAD defines the directory entries boundaries
213 * (must be a multiple of 4)
215 #define UFS_DIR_PAD 4
216 #define UFS_DIR_ROUND (UFS_DIR_PAD - 1)
217 #define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND)
219 struct ufs_timeval {
220 __s32 tv_sec;
221 __s32 tv_usec;
225 * File types
227 #define DT_UNKNOWN 0
228 #define DT_FIFO 1
229 #define DT_CHR 2
230 #define DT_DIR 4
231 #define DT_BLK 6
232 #define DT_REG 8
233 #define DT_LNK 10
234 #define DT_SOCK 12
235 #define DT_WHT 14
237 struct ufs_dir_entry {
238 __u32 d_ino; /* inode number of this entry */
239 __u16 d_reclen; /* length of this entry */
240 union {
241 __u16 d_namlen; /* actual length of d_name */
242 struct {
243 __u8 d_type; /* file type */
244 __u8 d_namlen; /* length of string in d_name */
245 } d_44;
246 } d_u;
247 __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */
250 struct ufs_csum {
251 __u32 cs_ndir; /* number of directories */
252 __u32 cs_nbfree; /* number of free blocks */
253 __u32 cs_nifree; /* number of free inodes */
254 __u32 cs_nffree; /* number of free frags */
258 * This is the actual superblock, as it is laid out on the disk.
260 struct ufs_super_block {
261 __u32 fs_link; /* UNUSED */
262 __u32 fs_rlink; /* UNUSED */
263 __u32 fs_sblkno; /* addr of super-block in filesys */
264 __u32 fs_cblkno; /* offset of cyl-block in filesys */
265 __u32 fs_iblkno; /* offset of inode-blocks in filesys */
266 __u32 fs_dblkno; /* offset of first data after cg */
267 __u32 fs_cgoffset; /* cylinder group offset in cylinder */
268 __u32 fs_cgmask; /* used to calc mod fs_ntrak */
269 __u32 fs_time; /* last time written -- time_t */
270 __u32 fs_size; /* number of blocks in fs */
271 __u32 fs_dsize; /* number of data blocks in fs */
272 __u32 fs_ncg; /* number of cylinder groups */
273 __u32 fs_bsize; /* size of basic blocks in fs */
274 __u32 fs_fsize; /* size of frag blocks in fs */
275 __u32 fs_frag; /* number of frags in a block in fs */
276 /* these are configuration parameters */
277 __u32 fs_minfree; /* minimum percentage of free blocks */
278 __u32 fs_rotdelay; /* num of ms for optimal next block */
279 __u32 fs_rps; /* disk revolutions per second */
280 /* these fields can be computed from the others */
281 __u32 fs_bmask; /* ``blkoff'' calc of blk offsets */
282 __u32 fs_fmask; /* ``fragoff'' calc of frag offsets */
283 __u32 fs_bshift; /* ``lblkno'' calc of logical blkno */
284 __u32 fs_fshift; /* ``numfrags'' calc number of frags */
285 /* these are configuration parameters */
286 __u32 fs_maxcontig; /* max number of contiguous blks */
287 __u32 fs_maxbpg; /* max number of blks per cyl group */
288 /* these fields can be computed from the others */
289 __u32 fs_fragshift; /* block to frag shift */
290 __u32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
291 __u32 fs_sbsize; /* actual size of super block */
292 __u32 fs_csmask; /* csum block offset */
293 __u32 fs_csshift; /* csum block number */
294 __u32 fs_nindir; /* value of NINDIR */
295 __u32 fs_inopb; /* value of INOPB */
296 __u32 fs_nspf; /* value of NSPF */
297 /* yet another configuration parameter */
298 __u32 fs_optim; /* optimization preference, see below */
299 /* these fields are derived from the hardware */
300 union {
301 struct {
302 __u32 fs_npsect; /* # sectors/track including spares */
303 } fs_sun;
304 struct {
305 __s32 fs_state; /* file system state time stamp */
306 } fs_sunx86;
307 } fs_u1;
308 __u32 fs_interleave; /* hardware sector interleave */
309 __u32 fs_trackskew; /* sector 0 skew, per track */
310 /* a unique id for this filesystem (currently unused and unmaintained) */
311 /* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */
312 /* Neither of those fields is used in the Tahoe code right now but */
313 /* there could be problems if they are. */
314 __u32 fs_id[2]; /* file system id */
315 /* sizes determined by number of cylinder groups and their sizes */
316 __u32 fs_csaddr; /* blk addr of cyl grp summary area */
317 __u32 fs_cssize; /* size of cyl grp summary area */
318 __u32 fs_cgsize; /* cylinder group size */
319 /* these fields are derived from the hardware */
320 __u32 fs_ntrak; /* tracks per cylinder */
321 __u32 fs_nsect; /* sectors per track */
322 __u32 fs_spc; /* sectors per cylinder */
323 /* this comes from the disk driver partitioning */
324 __u32 fs_ncyl; /* cylinders in file system */
325 /* these fields can be computed from the others */
326 __u32 fs_cpg; /* cylinders per group */
327 __u32 fs_ipg; /* inodes per group */
328 __u32 fs_fpg; /* blocks per group * fs_frag */
329 /* this data must be re-computed after crashes */
330 struct ufs_csum fs_cstotal; /* cylinder summary information */
331 /* these fields are cleared at mount time */
332 __s8 fs_fmod; /* super block modified flag */
333 __s8 fs_clean; /* file system is clean flag */
334 __s8 fs_ronly; /* mounted read-only flag */
335 __s8 fs_flags; /* currently unused flag */
336 __s8 fs_fsmnt[UFS_MAXMNTLEN]; /* name mounted on */
337 /* these fields retain the current block allocation info */
338 __u32 fs_cgrotor; /* last cg searched */
339 __u32 fs_csp[UFS_MAXCSBUFS]; /* list of fs_cs info buffers */
340 __u32 fs_maxcluster;
341 __u32 fs_cpc; /* cyl per cycle in postbl */
342 __u16 fs_opostbl[16][8]; /* old rotation block list head */
343 union {
344 struct {
345 __s32 fs_sparecon[53];/* reserved for future constants */
346 __s32 fs_reclaim;
347 __s32 fs_sparecon2[1];
348 __s32 fs_state; /* file system state time stamp */
349 __u32 fs_qbmask[2]; /* ~usb_bmask */
350 __u32 fs_qfmask[2]; /* ~usb_fmask */
351 } fs_sun;
352 struct {
353 __s32 fs_sparecon[53];/* reserved for future constants */
354 __s32 fs_reclaim;
355 __s32 fs_sparecon2[1];
356 __u32 fs_npsect; /* # sectors/track including spares */
357 __u32 fs_qbmask[2]; /* ~usb_bmask */
358 __u32 fs_qfmask[2]; /* ~usb_fmask */
359 } fs_sunx86;
360 struct {
361 __s32 fs_sparecon[50];/* reserved for future constants */
362 __s32 fs_contigsumsize;/* size of cluster summary array */
363 __s32 fs_maxsymlinklen;/* max length of an internal symlink */
364 __s32 fs_inodefmt; /* format of on-disk inodes */
365 __u32 fs_maxfilesize[2]; /* max representable file size */
366 __u32 fs_qbmask[2]; /* ~usb_bmask */
367 __u32 fs_qfmask[2]; /* ~usb_fmask */
368 __s32 fs_state; /* file system state time stamp */
369 } fs_44;
370 } fs_u2;
371 __s32 fs_postblformat; /* format of positional layout tables */
372 __s32 fs_nrpos; /* number of rotational positions */
373 __s32 fs_postbloff; /* (__s16) rotation block list head */
374 __s32 fs_rotbloff; /* (__u8) blocks for each rotation */
375 __s32 fs_magic; /* magic number */
376 __u8 fs_space[1]; /* list of blocks for each rotation */
380 * Preference for optimization.
382 #define UFS_OPTTIME 0 /* minimize allocation time */
383 #define UFS_OPTSPACE 1 /* minimize disk fragmentation */
386 * Rotational layout table format types
388 #define UFS_42POSTBLFMT -1 /* 4.2BSD rotational table format */
389 #define UFS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */
392 * Convert cylinder group to base address of its global summary info.
394 #define fs_cs(indx) \
395 u.ufs_sb.s_csp[(indx) >> uspi->s_csshift][(indx) & ~uspi->s_csmask]
398 * Cylinder group block for a file system.
400 * Writable fields in the cylinder group are protected by the associated
401 * super block lock fs->fs_lock.
403 #define CG_MAGIC 0x090255
404 #define ufs_cg_chkmagic(ucg) (SWAB32((ucg)->cg_magic) == CG_MAGIC)
407 * size of this structure is 172 B
409 struct ufs_cylinder_group {
410 __u32 cg_link; /* linked list of cyl groups */
411 __u32 cg_magic; /* magic number */
412 __u32 cg_time; /* time last written */
413 __u32 cg_cgx; /* we are the cgx'th cylinder group */
414 __u16 cg_ncyl; /* number of cyl's this cg */
415 __u16 cg_niblk; /* number of inode blocks this cg */
416 __u32 cg_ndblk; /* number of data blocks this cg */
417 struct ufs_csum cg_cs; /* cylinder summary information */
418 __u32 cg_rotor; /* position of last used block */
419 __u32 cg_frotor; /* position of last used frag */
420 __u32 cg_irotor; /* position of last used inode */
421 __u32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */
422 __u32 cg_btotoff; /* (__u32) block totals per cylinder */
423 __u32 cg_boff; /* (short) free block positions */
424 __u32 cg_iusedoff; /* (char) used inode map */
425 __u32 cg_freeoff; /* (u_char) free block map */
426 __u32 cg_nextfreeoff; /* (u_char) next available space */
427 union {
428 struct {
429 __u32 cg_clustersumoff; /* (u_int32) counts of avail clusters */
430 __u32 cg_clusteroff; /* (u_int8) free cluster map */
431 __u32 cg_nclusterblks; /* number of clusters this cg */
432 __u32 cg_sparecon[13]; /* reserved for future use */
433 } cg_44;
434 __u32 cg_sparecon[16]; /* reserved for future use */
435 } cg_u;
436 __u8 cg_space[1]; /* space for cylinder group maps */
437 /* actually longer */
441 * structure of an on-disk inode
443 struct ufs_inode {
444 __u16 ui_mode; /* 0x0 */
445 __u16 ui_nlink; /* 0x2 */
446 union {
447 struct {
448 __u16 ui_suid; /* 0x4 */
449 __u16 ui_sgid; /* 0x6 */
450 } oldids;
451 __u32 ui_inumber; /* 0x4 lsf: inode number */
452 __u32 ui_author; /* 0x4 GNU HURD: author */
453 } ui_u1;
454 __u64 ui_size; /* 0x8 */
455 struct ufs_timeval ui_atime; /* 0x10 access */
456 struct ufs_timeval ui_mtime; /* 0x18 modification */
457 struct ufs_timeval ui_ctime; /* 0x20 creation */
458 union {
459 struct {
460 __u32 ui_db[UFS_NDADDR];/* 0x28 data blocks */
461 __u32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */
462 } ui_addr;
463 __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
464 } ui_u2;
465 __u32 ui_flags; /* 0x64 immutable, append-only... */
466 __u32 ui_blocks; /* 0x68 blocks in use */
467 __u32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */
468 union {
469 struct {
470 __u32 ui_shadow; /* 0x70 shadow inode with security data */
471 __u32 ui_uid; /* 0x74 long EFT version of uid */
472 __u32 ui_gid; /* 0x78 long EFT version of gid */
473 __u32 ui_oeftflag; /* 0x7c reserved */
474 } ui_sun;
475 struct {
476 __u32 ui_uid; /* 0x70 File owner */
477 __u32 ui_gid; /* 0x74 File group */
478 __s32 ui_spare[2]; /* 0x78 reserved */
479 } ui_44;
480 struct {
481 __u32 ui_uid; /* 0x70 */
482 __u32 ui_gid; /* 0x74 */
483 __u16 ui_modeh; /* 0x78 mode high bits */
484 __u16 ui_spare; /* 0x7A unused */
485 __u32 ui_trans; /* 0x7c filesystem translator */
486 } ui_hurd;
487 } ui_u3;
490 /* FreeBSD has these in sys/stat.h */
491 /* ui_flags that can be set by a file owner */
492 #define UFS_UF_SETTABLE 0x0000ffff
493 #define UFS_UF_NODUMP 0x00000001 /* do not dump */
494 #define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */
495 #define UFS_UF_APPEND 0x00000004 /* append-only */
496 #define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */
497 #define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */
498 /* ui_flags that only root can set */
499 #define UFS_SF_SETTABLE 0xffff0000
500 #define UFS_SF_ARCHIVED 0x00010000 /* archived */
501 #define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */
502 #define UFS_SF_APPEND 0x00040000 /* append-only */
503 #define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */
505 #ifdef __KERNEL__
507 /* acl.c */
508 extern int ufs_permission (struct inode *, int);
510 /* balloc.c */
511 extern void ufs_free_fragments (struct inode *, unsigned, unsigned);
512 extern void ufs_free_blocks (struct inode *, unsigned, unsigned);
513 extern unsigned ufs_new_fragments (struct inode *, u32 *, unsigned, unsigned, unsigned, int *);
515 /* cylinder.c */
516 extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned);
517 extern void ufs_put_cylinder (struct super_block *, unsigned);
519 /* dir.c */
520 extern struct inode_operations ufs_dir_inode_operations;
521 extern struct file_operations ufs_dir_operations;
522 extern int ufs_check_dir_entry (const char *, struct inode *, struct ufs_dir_entry *, struct buffer_head *, unsigned long);
524 /* file.c */
525 extern struct inode_operations ufs_file_inode_operations;
526 extern struct file_operations ufs_file_operations;
528 /* ialloc.c */
529 extern void ufs_free_inode (struct inode *inode);
530 extern struct inode * ufs_new_inode (const struct inode *, int, int *);
532 /* inode.c */
533 extern int ufs_frag_map (struct inode *, int);
534 extern void ufs_read_inode (struct inode *);
535 extern void ufs_put_inode (struct inode *);
536 extern void ufs_write_inode (struct inode *);
537 extern int ufs_sync_inode (struct inode *);
538 extern void ufs_write_inode (struct inode *);
539 extern void ufs_delete_inode (struct inode *);
540 extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *);
541 extern int ufs_getfrag_block (struct inode *, long, struct buffer_head *, int);
542 extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
544 /* namei.c */
545 extern struct dentry *ufs_lookup (struct inode *, struct dentry *);
546 extern int ufs_mkdir(struct inode *, struct dentry *, int);
547 extern int ufs_rmdir (struct inode *, struct dentry *);
548 extern int ufs_unlink (struct inode *, struct dentry *);
549 extern int ufs_create (struct inode *, struct dentry *, int);
550 extern int ufs_rename (struct inode *, struct dentry *, struct inode *, struct dentry *);
551 extern int ufs_mknod (struct inode *, struct dentry *, int, int);
552 extern int ufs_symlink (struct inode *, struct dentry *, const char *);
553 extern int ufs_link (struct dentry *, struct inode *, struct dentry *);
555 /* super.c */
556 extern struct super_operations ufs_super_ops;
557 extern struct file_system_type ufs_fs_type;
558 extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
559 extern void ufs_error (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
560 extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
561 extern int init_ufs_fs(void);
562 extern void ufs_write_super (struct super_block *);
564 /* symlink.c */
565 extern struct inode_operations ufs_symlink_inode_operations;
567 /* truncate.c */
568 extern void ufs_truncate (struct inode *);
570 #endif /* __KERNEL__ */
572 #endif /* __LINUX_UFS_FS_H */