2 * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
4 * Copyright (C) 2002-2018 Aleph One Ltd.
6 * Created by Charles Manning <charles@aleph1.co.uk>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include "yaffs_attribs.h"
16 void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh)
19 #ifdef CONFIG_YAFFS_WINCE
20 obj->win_atime[0] = oh->win_atime[0];
21 obj->win_ctime[0] = oh->win_ctime[0];
22 obj->win_mtime[0] = oh->win_mtime[0];
23 obj->win_atime[1] = oh->win_atime[1];
24 obj->win_ctime[1] = oh->win_ctime[1];
25 obj->win_mtime[1] = oh->win_mtime[1];
27 obj->yst_uid = oh->yst_uid;
28 obj->yst_gid = oh->yst_gid;
30 obj->yst_ctime = yaffs_oh_ctime_fetch(oh);
31 obj->yst_mtime = yaffs_oh_mtime_fetch(oh);
32 obj->yst_atime = yaffs_oh_atime_fetch(oh);
34 obj->yst_rdev = oh->yst_rdev;
39 void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj)
41 #ifdef CONFIG_YAFFS_WINCE
42 oh->win_atime[0] = obj->win_atime[0];
43 oh->win_ctime[0] = obj->win_ctime[0];
44 oh->win_mtime[0] = obj->win_mtime[0];
45 oh->win_atime[1] = obj->win_atime[1];
46 oh->win_ctime[1] = obj->win_ctime[1];
47 oh->win_mtime[1] = obj->win_mtime[1];
49 oh->yst_uid = obj->yst_uid;
50 oh->yst_gid = obj->yst_gid;
52 yaffs_oh_ctime_load(obj, oh);
53 yaffs_oh_mtime_load(obj, oh);
54 yaffs_oh_atime_load(obj, oh);
56 oh->yst_rdev = obj->yst_rdev;
60 void yaffs_attribs_init(struct yaffs_obj *obj, u32 gid, u32 uid, u32 rdev)
63 #ifdef CONFIG_YAFFS_WINCE
64 yfsd_win_file_time_now(obj->win_atime);
65 obj->win_ctime[0] = obj->win_mtime[0] = obj->win_atime[0];
66 obj->win_ctime[1] = obj->win_mtime[1] = obj->win_atime[1];
69 yaffs_load_current_time(obj, 1, 1);
76 void yaffs_load_current_time(struct yaffs_obj *obj, int do_a, int do_c)
78 #ifdef CONFIG_YAFFS_WINCE
79 yfsd_win_file_time_now(obj->win_atime);
80 obj->win_ctime[0] = obj->win_mtime[0] =
82 obj->win_ctime[1] = obj->win_mtime[1] =
87 obj->yst_mtime = Y_CURRENT_TIME;
89 obj->yst_atime = obj->yst_mtime;
91 obj->yst_ctime = obj->yst_mtime;