X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fyaffsfs.c;h=2c1ac42eba1c8cefad544e6c8f7d79d37d96674e;hp=8593cbe72d82bb1745396c43fdf5f8a3873009d0;hb=9d9b662225f9b3684bb4ebd3646216f3ab190ed9;hpb=5e0db4930940ade57ea3bf3dce0d3db0362a9f0e diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 8593cbe..2c1ac42 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -1,8 +1,7 @@ /* * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * - * Copyright (C) 2002-2011 Aleph One Ltd. - * for Toby Churchill Ltd and Brightstar Engineering + * Copyright (C) 2002-2018 Aleph One Ltd. * * Created by Charles Manning * @@ -1944,17 +1943,21 @@ static int yaffsfs_DoUtime(struct yaffs_obj *obj, } #if !CONFIG_YAFFS_WINCE + // if the the buffer is null then create one with the fields set to the current time. if (!buf) { local.actime = Y_CURRENT_TIME; local.modtime = local.actime; buf = &local; } + // copy the buffer's time into the obj. if (obj) { int result; obj->yst_atime = buf->actime; obj->yst_mtime = buf->modtime; + + // set the obj to dirty to cause it to be written to flash during the next flush operation. obj->dirty = 1; result = yaffs_flush_file(obj, 0, 0, 0); retVal = result == YAFFS_OK ? 0 : -1; @@ -3051,6 +3054,7 @@ int yaffs_remount_common(struct yaffs_dev *dev, const YCHAR *path, int force, int read_only) { int retVal = -1; + int was_read_only; if (yaffsfs_CheckMemRegion(path, 0, 0) < 0) { yaffsfs_SetError(-EFAULT); @@ -3073,7 +3077,11 @@ int yaffs_remount_common(struct yaffs_dev *dev, const YCHAR *path, if (force || !yaffsfs_IsDevBusy(dev)) { if (read_only) yaffs_checkpoint_save(dev); + was_read_only = dev->read_only; dev->read_only = read_only ? 1 : 0; + if (was_read_only && !read_only) { + yaffs_guts_cleanup(dev); + } retVal = 0; } else yaffsfs_SetError(-EBUSY);