aboutsummaryrefslogtreecommitdiff
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authormarcin.slusarz@gmail.com <marcin.slusarz@gmail.com>2008-02-27 22:50:14 +0100
committerJan Kara <jack@suse.cz>2008-04-17 14:22:29 +0200
commitcbf5676a0e0463f05e5073589f3194846dfb02e7 (patch)
tree80407064556f2c7043d44533a7c9224e6af3e715 /fs/udf/inode.c
parentc87e8e90d0da1134e42c89dc89559f4bfe282ef9 (diff)
udf: convert udf_stamp_to_time to return struct timespec
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r--fs/udf/inode.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 3c0a60dad47..a7646e9bdbd 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1136,20 +1136,6 @@ static void __udf_read_inode(struct inode *inode)
brelse(bh);
}
-static void udf_fill_inode_time(struct timespec *tspec,
- const timestamp *tstamp,
- struct udf_sb_info *sbi)
-{
- time_t convtime;
- long convtime_usec;
- if (udf_stamp_to_time(&convtime, &convtime_usec,
- lets_to_cpu(*tstamp))) {
- tspec->tv_sec = convtime;
- tspec->tv_nsec = convtime_usec * 1000;
- } else
- *tspec = sbi->s_record_time;
-}
-
static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
{
struct fileEntry *fe;
@@ -1241,10 +1227,17 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) <<
(inode->i_sb->s_blocksize_bits - 9);
- udf_fill_inode_time(&inode->i_atime, &fe->accessTime, sbi);
- udf_fill_inode_time(&inode->i_mtime, &fe->modificationTime,
- sbi);
- udf_fill_inode_time(&inode->i_ctime, &fe->attrTime, sbi);
+ if (!udf_stamp_to_time(&inode->i_atime,
+ lets_to_cpu(fe->accessTime)))
+ inode->i_atime = sbi->s_record_time;
+
+ if (!udf_stamp_to_time(&inode->i_mtime,
+ lets_to_cpu(fe->modificationTime)))
+ inode->i_mtime = sbi->s_record_time;
+
+ if (!udf_stamp_to_time(&inode->i_ctime,
+ lets_to_cpu(fe->attrTime)))
+ inode->i_ctime = sbi->s_record_time;
iinfo->i_unique = le64_to_cpu(fe->uniqueID);
iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr);
@@ -1254,11 +1247,21 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) <<
(inode->i_sb->s_blocksize_bits - 9);
- udf_fill_inode_time(&inode->i_atime, &efe->accessTime, sbi);
- udf_fill_inode_time(&inode->i_mtime, &efe->modificationTime,
- sbi);
- udf_fill_inode_time(&iinfo->i_crtime, &efe->createTime, sbi);
- udf_fill_inode_time(&inode->i_ctime, &efe->attrTime, sbi);
+ if (!udf_stamp_to_time(&inode->i_atime,
+ lets_to_cpu(efe->accessTime)))
+ inode->i_atime = sbi->s_record_time;
+
+ if (!udf_stamp_to_time(&inode->i_mtime,
+ lets_to_cpu(efe->modificationTime)))
+ inode->i_mtime = sbi->s_record_time;
+
+ if (!udf_stamp_to_time(&iinfo->i_crtime,
+ lets_to_cpu(efe->createTime)))
+ iinfo->i_crtime = sbi->s_record_time;
+
+ if (!udf_stamp_to_time(&inode->i_ctime,
+ lets_to_cpu(efe->attrTime)))
+ inode->i_ctime = sbi->s_record_time;
iinfo->i_unique = le64_to_cpu(efe->uniqueID);
iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr);