netbsd dirent.h, import sys/sys *.h, mfs cleanup

. add all sys/sys headers not already present to help compiling
	. take netbsd dirent.h and struct dirent; main result is
	  introducing d_type and d_namlen that have to be set by getdents()
	  in all FS code implementing it
	. d_off is gone
	. alignment of the struct has become 8 bytes instead of 4
	. remove _MAX_BLOCK_SIZE, _MIN_BLOCK_SIZE, _STATIC_BLOCK_SIZE
	. libminlib: cleanup unused yet duplicate code
	. mfs: throw out the long-broken v1, v2 support
	. new test for dirent contents filled by getdents()

Change-Id: I1459755c7ba5e5d1c9396d3a587ce6e63ddc283e
This commit is contained in:
Ben Gras
2013-09-16 22:52:36 +02:00
committed by Lionel Sambuc
parent 664b726cd3
commit 6c8f7fc3ba
260 changed files with 37541 additions and 529 deletions

View File

@@ -43,11 +43,9 @@
*/
#include <sys/dirent.h>
#ifndef __minix
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#define d_ino d_fileno /* backward compatibility */
#endif
#endif /* !__minix */
typedef struct _dirdesc DIR;

View File

@@ -75,9 +75,7 @@ typedef struct {
#define FTS_PHYSICAL 0x010 /* physical walk */
#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
#define FTS_XDEV 0x040 /* don't cross devices */
#ifndef __minix
#define FTS_WHITEOUT 0x080 /* return whiteout information */
#endif
#define FTS_OPTIONMASK 0x0ff /* valid user option mask */
#define FTS_NAMEONLY 0x100 /* (private) child names only */

View File

@@ -2,7 +2,7 @@
INCSDIR= /usr/include/minix
INCS+= dirent.h paths.h param.h
INCS+= paths.h param.h
INCS+= acpi.h audio_fw.h bitmap.h \
bdev.h blockdriver.h blockdriver_mt.h \
board.h btrace.h \

View File

@@ -1,34 +0,0 @@
/* dirent.h - Declarations for directory reading routines.
* Author: Kees J. Bot
* 24 Apr 1989
*
* Note: The V7 format directory entries used under Minix must be transformed
* into a struct dirent with a d_name of at least 15 characters. Given that
* we have to transform V7 entries anyhow it is little trouble to let the
* routines understand the so-called "flex" directory format too.
*/
#ifndef _DIRENT_H
#define _DIRENT_H
#include <sys/cdefs.h>
/* Name of length len needs _EXTENT(len) extra slots. */
#define _EXTENT(len) (((len) + 5) >> 3)
/* The block size must be at least 1024 bytes, because otherwise
* the superblock (at 1024 bytes) overlaps with other filesystem data.
*/
#define _MIN_BLOCK_SIZE 1024
/* The below is allocated in some parts of the system as the largest
* a filesystem block can be. For instance, the boot monitor allocates
* 3 of these blocks and has to fit within 64kB, so this can't be
* increased without taking that into account.
*/
#define _MAX_BLOCK_SIZE 4096
/* This is the block size for the fixed versions of the filesystem (V1/V2) */
#define _STATIC_BLOCK_SIZE 1024
#endif /* _DIRENT_H */

View File

@@ -3,9 +3,4 @@
int bitmapsize(bit_t _nr_bits, int block_size);
unsigned conv2(int _norm, int _w);
long conv4(int _norm, long _x);
void conv_inode(struct inode *_rip, d1_inode *_dip, d2_inode *_dip2, int
_rw_flag, int _magic);
void old_icopy(struct inode *_rip, d1_inode *_dip, int _direction, int
_norm);
void new_icopy(struct inode *_rip, d2_inode *_dip, int _direction, int
_norm);
void new_icopy(struct inode *_rip, d2_inode *_dip, int _direction, int _norm);

View File

@@ -13,6 +13,7 @@ int fsversion(char *_dev, char *_prog);
int getprocessor(void);
void _cpuid(u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx);
int load_mtab(char *_prog_name);
uint8_t fs_mode_to_type(mode_t mode);
int get_mtab_entry(char dev[PATH_MAX], char mount_point[PATH_MAX],
char type[MNTNAMELEN], char flags[MNTFLAGLEN]);