X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_attribs.c;h=fe914e558b64cba94ef599e8b463cde40bf8117b;hp=651a473f7f53b50972a3eb9f56dfe9d307f9abe6;hb=6648cbf52d6695755941ff8607fd7a0cda542e05;hpb=a233a8fc212a32a50cc5f572cd4946e91cc9ca93 diff --git a/yaffs_attribs.c b/yaffs_attribs.c index 651a473..fe914e5 100644 --- a/yaffs_attribs.c +++ b/yaffs_attribs.c @@ -1,7 +1,7 @@ /* * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * - * Copyright (C) 2002-2010 Aleph One Ltd. + * Copyright (C) 2002-2011 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ - #include "yaffs_guts.h" #include "yaffs_attribs.h" @@ -27,7 +26,7 @@ void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj) { - oh->yst_uid = obj->yst_uid; + oh->yst_uid = obj->yst_uid; oh->yst_gid = obj->yst_gid; oh->yst_atime = obj->yst_atime; oh->yst_mtime = obj->yst_mtime; @@ -38,22 +37,21 @@ void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj) void yaffs_load_current_time(struct yaffs_obj *obj, int do_a, int do_c) { - obj->yst_mtime = Y_CURRENT_TIME; - if(do_a) - obj->yst_atime = obj->yst_atime; - if(do_c) - obj->yst_ctime = obj->yst_atime; + obj->yst_mtime = Y_CURRENT_TIME; + if (do_a) + obj->yst_atime = obj->yst_mtime; + if (do_c) + obj->yst_ctime = obj->yst_mtime; } void yaffs_attribs_init(struct yaffs_obj *obj, u32 gid, u32 uid, u32 rdev) { - yaffs_load_current_time(obj,1,1); + yaffs_load_current_time(obj, 1, 1); obj->yst_rdev = rdev; obj->yst_uid = uid; obj->yst_gid = gid; } - loff_t yaffs_get_file_size(struct yaffs_obj *obj) { YCHAR *alias = NULL; @@ -64,9 +62,9 @@ loff_t yaffs_get_file_size(struct yaffs_obj *obj) return obj->variant.file_variant.file_size; case YAFFS_OBJECT_TYPE_SYMLINK: alias = obj->variant.symlink_variant.alias; - if(!alias) + if (!alias) return 0; - return yaffs_strnlen(alias,YAFFS_MAX_ALIAS_LENGTH); + return strnlen(alias, YAFFS_MAX_ALIAS_LENGTH); default: return 0; } @@ -124,5 +122,3 @@ int yaffs_get_attribs(struct yaffs_obj *obj, struct iattr *attr) return YAFFS_OK; } - -