X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=yaffs_guts.c;h=79a798808c56660f8bbe223d90b2a2e9e1488d1e;hb=20de150d680c2a84c4a2e0d5f0f354274c7ff9ab;hp=146fb2b75ca5a7f3ae78cedd6cfda356da4d61dd;hpb=b4d93e23d5d94ff4de6c5d1f420153661fc6a0b3;p=yaffs2.git diff --git a/yaffs_guts.c b/yaffs_guts.c index 146fb2b..79a7988 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -44,8 +44,8 @@ static int yaffs_wr_data_obj(struct yaffs_obj *in, int inode_chunk, /* Function to calculate chunk and offset */ -static inline void yaffs_addr_to_chunk(struct yaffs_dev *dev, loff_t addr, - int *chunk_out, u32 *offset_out) +void yaffs_addr_to_chunk(struct yaffs_dev *dev, loff_t addr, + int *chunk_out, u32 *offset_out) { int chunk; u32 offset; @@ -5001,7 +5001,13 @@ void yaffs_oh_size_load(struct yaffs_obj_hdr *oh, loff_t fsize) loff_t yaffs_oh_to_size(struct yaffs_obj_hdr *oh) { - loff_t retval = (((loff_t) oh->file_size_high) << 32) | + loff_t retval; + + if(~(oh->file_size_high)) + retval = (((loff_t) oh->file_size_high) << 32) | (((loff_t) oh->file_size_low) & 0xFFFFFFFF); + else + retval = (loff_t) oh->file_size_low; + return retval; }