diff options
author | Artem B. Bityutskiy <dedekind@infradead.org> | 2005-08-17 09:46:26 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 14:25:59 -0500 |
commit | 3a69e0cd22cf34920508a4032d53e41251925f53 (patch) | |
tree | f6f862aa743e3de98e348c20d84a26772da06195 /fs/jffs2/gc.c | |
parent | 01d445f89d68187c9ada7b58ca939dbb987c9fbd (diff) |
[JFFS2] Fix JFFS2 [mc]time handling
From: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/gc.c')
-rw-r--r-- | fs/jffs2/gc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 362cfeed7327..def97157ecbd 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in this directory. | 8 | * For licensing information, see the file 'LICENCE' in this directory. |
9 | * | 9 | * |
10 | * $Id: gc.c,v 1.152 2005/07/24 15:14:14 dedekind Exp $ | 10 | * $Id: gc.c,v 1.153 2005/08/17 13:46:22 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -771,7 +771,12 @@ static int jffs2_garbage_collect_dirent(struct jffs2_sb_info *c, struct jffs2_er | |||
771 | rd.pino = cpu_to_je32(f->inocache->ino); | 771 | rd.pino = cpu_to_je32(f->inocache->ino); |
772 | rd.version = cpu_to_je32(++f->highest_version); | 772 | rd.version = cpu_to_je32(++f->highest_version); |
773 | rd.ino = cpu_to_je32(fd->ino); | 773 | rd.ino = cpu_to_je32(fd->ino); |
774 | rd.mctime = cpu_to_je32(max(JFFS2_F_I_MTIME(f), JFFS2_F_I_CTIME(f))); | 774 | /* If the times on this inode were set by explicit utime() they can be different, |
775 | so refrain from splatting them. */ | ||
776 | if (JFFS2_F_I_MTIME(f) == JFFS2_F_I_CTIME(f)) | ||
777 | rd.mctime = cpu_to_je32(JFFS2_F_I_MTIME(f)); | ||
778 | else | ||
779 | rd.mctime = cpu_to_je32(0); | ||
775 | rd.type = fd->type; | 780 | rd.type = fd->type; |
776 | rd.node_crc = cpu_to_je32(crc32(0, &rd, sizeof(rd)-8)); | 781 | rd.node_crc = cpu_to_je32(crc32(0, &rd, sizeof(rd)-8)); |
777 | rd.name_crc = cpu_to_je32(crc32(0, fd->name, rd.nsize)); | 782 | rd.name_crc = cpu_to_je32(crc32(0, fd->name, rd.nsize)); |
@@ -883,6 +888,9 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct | |||
883 | kfree(rd); | 888 | kfree(rd); |
884 | } | 889 | } |
885 | 890 | ||
891 | /* FIXME: If we're deleting a dirent which contains the current mtime and ctime, | ||
892 | we should update the metadata node with those times accordingly */ | ||
893 | |||
886 | /* No need for it any more. Just mark it obsolete and remove it from the list */ | 894 | /* No need for it any more. Just mark it obsolete and remove it from the list */ |
887 | while (*fdp) { | 895 | while (*fdp) { |
888 | if ((*fdp) == fd) { | 896 | if ((*fdp) == fd) { |