X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=yaffs_attribs.c;h=c441185a68dcb07a45b1bb2b829ffda8afe3ac12;hb=e12e51da5815d80399ec8f5b0da69c7cd7a0f42e;hp=711941f137f554a2a32cd32edafd60049f7bc435;hpb=4e188b08c5531f99f73383a85251e03a1e667b26;p=yaffs2.git diff --git a/yaffs_attribs.c b/yaffs_attribs.c index 711941f..c441185 100644 --- a/yaffs_attribs.c +++ b/yaffs_attribs.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 * @@ -22,13 +21,19 @@ #define IATTR_GID ia_gid.val #endif +/* + * Loading attibs from/to object header assumes the object header + * is in cpu endian. + */ void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) { obj->yst_uid = oh->yst_uid; obj->yst_gid = oh->yst_gid; - obj->yst_atime = oh->yst_atime; - obj->yst_mtime = oh->yst_mtime; - obj->yst_ctime = oh->yst_ctime; + + obj->yst_ctime = yaffs_oh_ctime_fetch(oh); + obj->yst_mtime = yaffs_oh_mtime_fetch(oh); + obj->yst_atime = yaffs_oh_atime_fetch(oh); + obj->yst_rdev = oh->yst_rdev; } @@ -36,9 +41,11 @@ void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj) { oh->yst_uid = obj->yst_uid; oh->yst_gid = obj->yst_gid; - oh->yst_atime = obj->yst_atime; - oh->yst_mtime = obj->yst_mtime; - oh->yst_ctime = obj->yst_ctime; + + yaffs_oh_ctime_load(obj, oh); + yaffs_oh_mtime_load(obj, oh); + yaffs_oh_atime_load(obj, oh); + oh->yst_rdev = obj->yst_rdev; } @@ -102,7 +109,6 @@ int yaffs_set_attribs(struct yaffs_obj *obj, struct iattr *attr) yaffs_update_oh(obj, NULL, 1, 0, 0, NULL); return YAFFS_OK; - } int yaffs_get_attribs(struct yaffs_obj *obj, struct iattr *attr)