--- fat-epoc/trunk/fat-epoc-2.6.19.diff 2007/09/29 23:55:30 306 +++ fat-epoc/trunk/fat-epoc-2.6.19.diff 2007/11/09 10:58:41 309 @@ -1,72 +1,64 @@ -diff -up -r linux-2.6.19.org/fs/fat/dir.c linux-2.6.19/fs/fat/dir.c ---- linux-2.6.19.org/fs/fat/dir.c 2007-09-29 15:27:28.000000000 +0200 -+++ linux-2.6.19/fs/fat/dir.c 2007-09-29 15:28:16.000000000 +0200 -@@ -241,6 +241,7 @@ static int fat_parse_long(struct inode * - { +diff -r -u2 -p linux-2.6.19.vanilla/fs/fat/dir.c linux-2.6.19/fs/fat/dir.c +--- linux-2.6.19.vanilla/fs/fat/dir.c 2007-11-09 11:31:48.000000000 +0100 ++++ linux-2.6.19/fs/fat/dir.c 2007-11-09 11:37:58.000000000 +0100 +@@ -242,4 +242,5 @@ static int fat_parse_long(struct inode * struct msdos_dir_slot *ds; unsigned char id, slot, slots, alias_checksum; + int epoc = MSDOS_SB(dir->i_sb)->options.epoc; if (!*unicode) { - *unicode = (wchar_t *)__get_free_page(GFP_KERNEL); -@@ -287,6 +288,8 @@ parse_long: - } +@@ -288,4 +289,8 @@ parse_long: if ((*de)->name[0] == DELETED_FLAG) return PARSE_INVALID; -+ if (epoc && ((*de)->name[0] == EOD_FLAG)) ++ if (epoc && ((*de)->name[0] == EOD_FLAG)) { ++ while (fat_get_entry(dir, pos, bh, de) >= 0); + return PARSE_EOF; ++ } if ((*de)->attr == ATTR_EXT) goto parse_long; - if (IS_FREE((*de)->name) || ((*de)->attr & ATTR_VOLUME)) -@@ -320,6 +323,7 @@ int fat_search_long(struct inode *inode, - unsigned short opt_shortname = sbi->options.shortname; +@@ -321,4 +326,5 @@ int fat_search_long(struct inode *inode, loff_t cpos = 0; int chl, i, j, last_u, err; + int epoc = sbi->options.epoc; err = -ENOENT; - while(1) { -@@ -329,6 +333,9 @@ parse_record: - nr_slots = 0; +@@ -330,4 +336,8 @@ parse_record: if (de->name[0] == DELETED_FLAG) continue; -+ if (epoc && (de->name[0] == EOD_FLAG)) ++ if (epoc && (de->name[0] == EOD_FLAG)) { ++ while (fat_get_entry(inode, &cpos, &bh, &de) >= 0); + goto EODir; -+ ++ } if (de->attr != ATTR_EXT && (de->attr & ATTR_VOLUME)) continue; - if (de->attr != ATTR_EXT && IS_FREE(de->name)) -@@ -456,6 +463,8 @@ static int __fat_readdir(struct inode *i - int chi, chl, i, i2, j, last, last_u, dotoffset = 0; +@@ -457,4 +467,6 @@ static int __fat_readdir(struct inode *i loff_t cpos; int ret = 0; + int epoc = MSDOS_SB(sb)->options.epoc; + lock_kernel(); - -@@ -486,6 +495,8 @@ GetNew: - parse_record: +@@ -487,4 +499,8 @@ parse_record: long_slots = 0; /* Check for long filename entry */ -+ if (epoc && (de->name[0] == EOD_FLAG)) ++ if (epoc && (de->name[0] == EOD_FLAG)) { ++ while (fat_get_entry(inode, &cpos, &bh, &de) >= 0); + goto EODir; ++ } if (isvfat) { if (de->name[0] == DELETED_FLAG) - goto RecEnd; -@@ -808,7 +819,10 @@ static int fat_get_short_entry(struct in - struct buffer_head **bh, +@@ -809,5 +825,10 @@ static int fat_get_short_entry(struct in struct msdos_dir_entry **de) { + int epoc = MSDOS_SB(dir->i_sb)->options.epoc; while (fat_get_entry(dir, pos, bh, de) >= 0) { -+ if (epoc && ((*de)->name[0] == EOD_FLAG)) ++ if (epoc && ((*de)->name[0] == EOD_FLAG)) { ++ while (fat_get_entry(dir, pos, bh, de) >= 0); + return -ENOENT; ++ } /* free entry or long name entry or volume label */ if (!IS_FREE((*de)->name) && !((*de)->attr & ATTR_VOLUME)) - return 0; -@@ -1186,6 +1200,25 @@ error: - return err; +@@ -1187,4 +1208,23 @@ error: } +int fat_write_zero_entry(struct inode *dir, loff_t curr) @@ -90,18 +82,14 @@ + int fat_add_entries(struct inode *dir, void *slots, int nr_slots, struct fat_slot_info *sinfo) - { -@@ -1195,6 +1228,8 @@ int fat_add_entries(struct inode *dir, v - struct msdos_dir_entry *de; +@@ -1196,4 +1236,6 @@ int fat_add_entries(struct inode *dir, v int err, free_slots, i, nr_bhs; loff_t pos, i_pos; + int epoc = sbi->options.epoc; + int last_entry = 0; sinfo->nr_slots = nr_slots; - -@@ -1208,7 +1243,9 @@ int fat_add_entries(struct inode *dir, v - if (pos >= FAT_MAX_DIR_SIZE) +@@ -1209,5 +1251,7 @@ int fat_add_entries(struct inode *dir, v goto error; - if (IS_FREE(de->name)) { @@ -110,9 +98,7 @@ + if (last_entry || IS_FREE(de->name)) { if (prev != bh) { get_bh(bh); - bhs[nr_bhs] = prev = bh; -@@ -1238,6 +1275,17 @@ found: - err = 0; +@@ -1239,4 +1283,15 @@ found: pos -= free_slots * sizeof(*de); nr_slots -= free_slots; + @@ -128,28 +114,22 @@ + if (free_slots) { /* - * Second stage: filling the free entries with new entries. -diff -up -r linux-2.6.19.org/fs/fat/inode.c linux-2.6.19/fs/fat/inode.c ---- linux-2.6.19.org/fs/fat/inode.c 2007-09-29 15:27:28.000000000 +0200 -+++ linux-2.6.19/fs/fat/inode.c 2007-09-29 15:29:36.000000000 +0200 -@@ -854,6 +854,7 @@ enum { - Opt_charset, Opt_shortname_lower, Opt_shortname_win95, +diff -r -u2 -p linux-2.6.19.vanilla/fs/fat/inode.c linux-2.6.19/fs/fat/inode.c +--- linux-2.6.19.vanilla/fs/fat/inode.c 2007-11-09 11:31:48.000000000 +0100 ++++ linux-2.6.19/fs/fat/inode.c 2007-11-09 11:37:58.000000000 +0100 +@@ -855,4 +855,5 @@ enum { Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, + Opt_epoc, Opt_obsolate, Opt_flush, Opt_err, }; - -@@ -875,6 +876,7 @@ static match_table_t fat_tokens = { - {Opt_showexec, "showexec"}, +@@ -876,4 +877,5 @@ static match_table_t fat_tokens = { {Opt_debug, "debug"}, {Opt_immutable, "sys_immutable"}, + {Opt_epoc, "epoc"}, {Opt_obsolate, "conv=binary"}, {Opt_obsolate, "conv=text"}, - {Opt_obsolate, "conv=auto"}, -@@ -1031,6 +1033,10 @@ static int parse_options(char *options, - case Opt_flush: +@@ -1032,4 +1034,8 @@ static int parse_options(char *options, opts->flush = 1; break; + case Opt_epoc: @@ -158,24 +138,20 @@ + /* msdos specific */ - case Opt_dots: -diff -up -r linux-2.6.19.org/include/linux/msdos_fs.h linux-2.6.19/include/linux/msdos_fs.h ---- linux-2.6.19.org/include/linux/msdos_fs.h 2007-09-29 15:27:43.000000000 +0200 -+++ linux-2.6.19/include/linux/msdos_fs.h 2007-09-29 15:31:01.000000000 +0200 -@@ -44,6 +44,7 @@ - #define CASE_LOWER_EXT 16 /* extension is lower case */ +diff -r -u2 -p linux-2.6.19.vanilla/include/linux/msdos_fs.h linux-2.6.19/include/linux/msdos_fs.h +--- linux-2.6.19.vanilla/include/linux/msdos_fs.h 2007-11-09 11:32:00.000000000 +0100 ++++ linux-2.6.19/include/linux/msdos_fs.h 2007-11-09 11:39:36.000000000 +0100 +@@ -45,4 +45,5 @@ #define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */ +#define EOD_FLAG 0x00 /* marks end of directory when in name[0] for old fats */ #define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG) - /* valid file mode bits */ -@@ -206,6 +207,7 @@ struct fat_mount_options { +@@ -206,5 +207,6 @@ struct fat_mount_options { atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ flush:1, /* write things quickly */ -- nocase:1; /* Does this need case conversion? 0=need case conversion*/ +- nocase:1; /* Does this need case conversion? 0=need case conversion*/ + nocase:1, /* Does this need case conversion? 0=need case conversion*/ + epoc:1; /* Filename starting with 0x00 marks end of dir? */ }; - #define FAT_HASH_BITS 8