aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authormarcin.slusarz@gmail.com <marcin.slusarz@gmail.com>2008-02-27 16:50:14 -0500
committerJan Kara <jack@suse.cz>2008-04-17 08:22:29 -0400
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 3c0a60dad478..a7646e9bdbde 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1136,20 +1136,6 @@ static void __udf_read_inode(struct inode *inode)
1136 brelse(bh); 1136 brelse(bh);
1137} 1137}
1138 1138
1139static void udf_fill_inode_time(struct timespec *tspec,
1140 const timestamp *tstamp,
1141 struct udf_sb_info *sbi)
1142{
1143 time_t convtime;
1144 long convtime_usec;
1145 if (udf_stamp_to_time(&convtime, &convtime_usec,
1146 lets_to_cpu(*tstamp))) {
1147 tspec->tv_sec = convtime;
1148 tspec->tv_nsec = convtime_usec * 1000;
1149 } else
1150 *tspec = sbi->s_record_time;
1151}
1152
1153static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) 1139static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1154{ 1140{
1155 struct fileEntry *fe; 1141 struct fileEntry *fe;
@@ -1241,10 +1227,17 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1241 inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << 1227 inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) <<
1242 (inode->i_sb->s_blocksize_bits - 9); 1228 (inode->i_sb->s_blocksize_bits - 9);
1243 1229
1244 udf_fill_inode_time(&inode->i_atime, &fe->accessTime, sbi); 1230 if (!udf_stamp_to_time(&inode->i_atime,
1245 udf_fill_inode_time(&inode->i_mtime, &fe->modificationTime, 1231 lets_to_cpu(fe->accessTime)))
1246 sbi); 1232 inode->i_atime = sbi->s_record_time;
1247 udf_fill_inode_time(&inode->i_ctime, &fe->attrTime, sbi); 1233
1234 if (!udf_stamp_to_time(&inode->i_mtime,
1235 lets_to_cpu(fe->modificationTime)))
1236 inode->i_mtime = sbi->s_record_time;
1237
1238 if (!udf_stamp_to_time(&inode->i_ctime,
1239 lets_to_cpu(fe->attrTime)))
1240 inode->i_ctime = sbi->s_record_time;
1248 1241
1249 iinfo->i_unique = le64_to_cpu(fe->uniqueID); 1242 iinfo->i_unique = le64_to_cpu(fe->uniqueID);
1250 iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); 1243 iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr);
@@ -1254,11 +1247,21 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1254 inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << 1247 inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) <<
1255 (inode->i_sb->s_blocksize_bits - 9); 1248 (inode->i_sb->s_blocksize_bits - 9);
1256 1249
1257 udf_fill_inode_time(&inode->i_atime, &efe->accessTime, sbi); 1250 if (!udf_stamp_to_time(&inode->i_atime,
1258 udf_fill_inode_time(&inode->i_mtime, &efe->modificationTime, 1251 lets_to_cpu(efe->accessTime)))
1259 sbi); 1252 inode->i_atime = sbi->s_record_time;
1260 udf_fill_inode_time(&iinfo->i_crtime, &efe->createTime, sbi); 1253
1261 udf_fill_inode_time(&inode->i_ctime, &efe->attrTime, sbi); 1254 if (!udf_stamp_to_time(&inode->i_mtime,
1255 lets_to_cpu(efe->modificationTime)))
1256 inode->i_mtime = sbi->s_record_time;
1257
1258 if (!udf_stamp_to_time(&iinfo->i_crtime,
1259 lets_to_cpu(efe->createTime)))
1260 iinfo->i_crtime = sbi->s_record_time;
1261
1262 if (!udf_stamp_to_time(&inode->i_ctime,
1263 lets_to_cpu(efe->attrTime)))
1264 inode->i_ctime = sbi->s_record_time;
1262 1265
1263 iinfo->i_unique = le64_to_cpu(efe->uniqueID); 1266 iinfo->i_unique = le64_to_cpu(efe->uniqueID);
1264 iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); 1267 iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr);