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)
18 #ifdef CONFIG_YAFFS_WINCE
19 obj->win_atime[0] = oh->win_atime[0];
20 obj->win_ctime[0] = oh->win_ctime[0];
21 obj->win_mtime[0] = oh->win_mtime[0];
22 obj->win_atime[1] = oh->win_atime[1];
23 obj->win_ctime[1] = oh->win_ctime[1];
24 obj->win_mtime[1] = oh->win_mtime[1];
26 obj->yst_uid = oh->yst_uid;
27 obj->yst_gid = oh->yst_gid;
28 obj->yst_atime = oh->yst_atime;
29 obj->yst_mtime = oh->yst_mtime;
30 obj->yst_ctime = oh->yst_ctime;
31 obj->yst_rdev = oh->yst_rdev;
36 void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj)
38 #ifdef CONFIG_YAFFS_WINCE
39 oh->win_atime[0] = obj->win_atime[0];
40 oh->win_ctime[0] = obj->win_ctime[0];
41 oh->win_mtime[0] = obj->win_mtime[0];
42 oh->win_atime[1] = obj->win_atime[1];
43 oh->win_ctime[1] = obj->win_ctime[1];
44 oh->win_mtime[1] = obj->win_mtime[1];
46 oh->yst_uid = obj->yst_uid;
47 oh->yst_gid = obj->yst_gid;
48 oh->yst_atime = obj->yst_atime;
49 oh->yst_mtime = obj->yst_mtime;
50 oh->yst_ctime = obj->yst_ctime;
51 oh->yst_rdev = obj->yst_rdev;
55 void yaffs_attribs_init(struct yaffs_obj *obj, u32 gid, u32 uid, u32 rdev)
58 #ifdef CONFIG_YAFFS_WINCE
59 yfsd_win_file_time_now(obj->win_atime);
60 obj->win_ctime[0] = obj->win_mtime[0] = obj->win_atime[0];
61 obj->win_ctime[1] = obj->win_mtime[1] = obj->win_atime[1];
64 yaffs_load_current_time(obj, 1, 1);
71 void yaffs_load_current_time(struct yaffs_obj *obj, int do_a, int do_c)
73 #ifdef CONFIG_YAFFS_WINCE
74 yfsd_win_file_time_now(obj->win_atime);
75 obj->win_ctime[0] = obj->win_mtime[0] =
77 obj->win_ctime[1] = obj->win_mtime[1] =
82 obj->yst_mtime = Y_CURRENT_TIME;
84 obj->yst_atime = obj->yst_atime;
86 obj->yst_ctime = obj->yst_atime;