patch-2.1.60 linux/include/linux/msdos_fs.h

Next file: linux/include/linux/msdos_fs_i.h
Previous file: linux/include/linux/module.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.59/linux/include/linux/msdos_fs.h linux/include/linux/msdos_fs.h
@@ -73,7 +73,9 @@
 
 #define EOF_FAT12 0xFF8		/* standard EOF */
 #define EOF_FAT16 0xFFF8
-#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 16 ? 0xFFF8 : 0xFF8)
+#define EOF_FAT32 0xFFFFFF8
+#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? EOF_FAT32 : \
+	MSDOS_SB(s)->fat_bits == 16 ? EOF_FAT16 : EOF_FAT12)
 
 /*
  * Inode flags
@@ -83,8 +85,8 @@
 /*
  * ioctl commands
  */
-#define	VFAT_IOCTL_READDIR_BOTH		_IOR('r', 1, long)
-#define	VFAT_IOCTL_READDIR_SHORT	_IOW('r', 2, long)
+#define	VFAT_IOCTL_READDIR_BOTH		_IOR('r', 1, struct dirent [2])
+#define	VFAT_IOCTL_READDIR_SHORT	_IOR('r', 2, struct dirent [2])
 
 /*
  * Conversion from and to little-endian byte order. (no-op on i386/i486)
@@ -98,7 +100,7 @@
 #define CT_LE_W(v) cpu_to_le16(v)
 #define CT_LE_L(v) cpu_to_le32(v)
 
-struct msdos_boot_sector {
+struct fat_boot_sector {
 	__s8	ignored[3];	/* Boot strap short or near jump */
 	__s8	system_id[8];	/* Name - can be used to special case
 				   partition manager volumes */
@@ -114,6 +116,24 @@
 	__u16	heads;		/* number of heads */
 	__u32	hidden;		/* hidden sectors (unused) */
 	__u32	total_sect;	/* number of sectors (if sectors == 0) */
+
+	/* The following fields are only used by FAT32 */
+	__u32	fat32_length;	/* sectors/FAT */
+	__u16	flags;		/* bit 8: fat mirroring, low 4: active fat */
+	__u8	version[2];	/* major, minor filesystem version */
+	__u32	root_cluster;	/* first cluster in root directory */
+	__u16	info_sector;	/* filesystem info sector */
+	__u16	backup_boot;	/* backup boot sector */
+	__u16	reserved2[6];	/* Unused */
+};
+
+struct fat_boot_fsinfo {
+	__u32   reserved1;	/* Nothing as far as I can tell */
+	__u32   signature;	/* 0x61417272L */
+	__u32   free_clusters;	/* Free cluster count.  -1 if unknown */
+	__u32   next_cluster;	/* Most recently allocated cluster.
+				 * Unused under Linux. */
+	__u32   reserved2[4];
 };
 
 struct msdos_dir_entry {
@@ -124,7 +144,7 @@
 	__u16	ctime;		/* Creation time */
 	__u16	cdate;		/* Creation date */
 	__u16	adate;		/* Last access date */
-	__u8    unused[2];
+	__u16   starthi;	/* High 16 bits of cluster in FAT32 */
 	__u16	time,date,start;/* time, date and first cluster */
 	__u32	size;		/* file size (in bytes) */
 };
@@ -137,7 +157,7 @@
 	__u8    reserved;	/* always 0 */
 	__u8    alias_checksum;	/* checksum for 8.3 alias */
 	__u8    name5_10[12];	/* 6 more characters in name */
-	__u8    start[2];	/* starting cluster number */
+	__u16   start;		/* starting cluster number, 0 in long slots */
 	__u8    name11_12[4];	/* last 2 characters in name */
 };
 
@@ -190,6 +210,7 @@
 		    struct msdos_dir_entry **res_de,int *ino,char scantype);
 extern int fat_parent_ino(struct inode *dir,int locked);
 extern int fat_subdirs(struct inode *dir);
+void fat_clusters_flush(struct super_block *sb);
 
 /* fat.c */
 extern int fat_access(struct super_block *sb,int nr,int new_value);
@@ -227,8 +248,8 @@
 /* file.c */
 extern struct inode_operations fat_file_inode_operations;
 extern struct inode_operations fat_file_inode_operations_1024;
-extern long fat_file_read(struct inode *, struct file *, char *, unsigned long);
-extern long fat_file_write(struct inode *, struct file *, const char *, unsigned long);
+extern ssize_t fat_file_read(struct file *, char *, size_t, loff_t *);
+extern ssize_t fat_file_write(struct file *, const char *, size_t, loff_t *);
 extern void fat_truncate(struct inode *inode);
 
 /* mmap.c */
@@ -257,12 +278,30 @@
 extern int msdos_rename(struct inode *old_dir,struct dentry *old_dentry,
 			struct inode *new_dir,struct dentry *new_dentry);
 
+/* nls.c */
+extern int init_fat_nls(void);
+extern struct fat_nls_table *fat_load_nls(int codepage);
+
+/* tables.c */
+extern unsigned char fat_uni2esc[];
+extern unsigned char fat_esc2uni[];
+
 /* fatfs_syms.c */
 extern int init_fat_fs(void);
+extern void cleanup_fat_fs(void);
+
+/* nls.c */
+extern int fat_register_nls(struct fat_nls_table * fmt);
+extern int fat_unregister_nls(struct fat_nls_table * fmt);
+extern struct fat_nls_table *fat_find_nls(int codepage);
+extern struct fat_nls_table *fat_load_nls(int codepage);
+extern void fat_unload_nls(int codepage);
+extern int init_fat_nls(void);
 
 /* vfat/namei.c - these are for dmsdos */
 extern int vfat_create(struct inode *dir,struct dentry *dentry,int mode);
 extern int vfat_unlink(struct inode *dir,struct dentry *dentry);
+extern int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry);
 extern int vfat_mkdir(struct inode *dir,struct dentry *dentry,int mode);
 extern int vfat_rmdir(struct inode *dir,struct dentry *dentry);
 extern int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
@@ -272,6 +311,9 @@
 					   int silent);
 extern void vfat_read_inode(struct inode *inode);
 extern int vfat_lookup(struct inode *dir,struct dentry *);
+
+/* vfat/vfatfs_syms.c */
+extern struct file_system_type vfat_fs_type;
 
 #endif /* __KERNEL__ */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov