diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-02-10 05:25:31 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2008-04-17 08:22:29 -0400 |
commit | 56774805d5eeecd3f1fb700603e593a35dc523c8 (patch) | |
tree | 525665c2a2b4fe93cf4a74b8c50332e70acf357f /fs/udf/super.c | |
parent | cbf5676a0e0463f05e5073589f3194846dfb02e7 (diff) |
udf: convert udf_stamp_to_time and udf_time_to_stamp to use timestamps
* kernel_timestamp type was almost unused - only callers of udf_stamp_to_time
and udf_time_to_stamp used it, so let these functions handle endianness
internally and don't clutter code with conversions
* rename udf_stamp_to_time to udf_disk_stamp_to_time
and udf_time_to_stamp to udf_time_to_disk_stamp
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index f4cdd530c65f..4d2ecee1970b 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -943,8 +943,8 @@ static void udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh) | |||
943 | 943 | ||
944 | pvoldesc = (struct primaryVolDesc *)bh->b_data; | 944 | pvoldesc = (struct primaryVolDesc *)bh->b_data; |
945 | 945 | ||
946 | if (udf_stamp_to_time(&UDF_SB(sb)->s_record_time, | 946 | if (udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time, |
947 | lets_to_cpu(pvoldesc->recordingDateAndTime))) { | 947 | pvoldesc->recordingDateAndTime)) { |
948 | kernel_timestamp ts; | 948 | kernel_timestamp ts; |
949 | ts = lets_to_cpu(pvoldesc->recordingDateAndTime); | 949 | ts = lets_to_cpu(pvoldesc->recordingDateAndTime); |
950 | udf_debug("recording time %04u/%02u/%02u" | 950 | udf_debug("recording time %04u/%02u/%02u" |
@@ -1589,7 +1589,6 @@ static void udf_open_lvid(struct super_block *sb) | |||
1589 | struct udf_sb_info *sbi = UDF_SB(sb); | 1589 | struct udf_sb_info *sbi = UDF_SB(sb); |
1590 | struct buffer_head *bh = sbi->s_lvid_bh; | 1590 | struct buffer_head *bh = sbi->s_lvid_bh; |
1591 | if (bh) { | 1591 | if (bh) { |
1592 | kernel_timestamp cpu_time; | ||
1593 | struct logicalVolIntegrityDesc *lvid = | 1592 | struct logicalVolIntegrityDesc *lvid = |
1594 | (struct logicalVolIntegrityDesc *)bh->b_data; | 1593 | (struct logicalVolIntegrityDesc *)bh->b_data; |
1595 | struct logicalVolIntegrityDescImpUse *lvidiu = | 1594 | struct logicalVolIntegrityDescImpUse *lvidiu = |
@@ -1597,8 +1596,8 @@ static void udf_open_lvid(struct super_block *sb) | |||
1597 | 1596 | ||
1598 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; | 1597 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; |
1599 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; | 1598 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; |
1600 | if (udf_time_to_stamp(&cpu_time, CURRENT_TIME)) | 1599 | udf_time_to_disk_stamp(&lvid->recordingDateAndTime, |
1601 | lvid->recordingDateAndTime = cpu_to_lets(cpu_time); | 1600 | CURRENT_TIME); |
1602 | lvid->integrityType = LVID_INTEGRITY_TYPE_OPEN; | 1601 | lvid->integrityType = LVID_INTEGRITY_TYPE_OPEN; |
1603 | 1602 | ||
1604 | lvid->descTag.descCRC = cpu_to_le16( | 1603 | lvid->descTag.descCRC = cpu_to_le16( |
@@ -1613,7 +1612,6 @@ static void udf_open_lvid(struct super_block *sb) | |||
1613 | 1612 | ||
1614 | static void udf_close_lvid(struct super_block *sb) | 1613 | static void udf_close_lvid(struct super_block *sb) |
1615 | { | 1614 | { |
1616 | kernel_timestamp cpu_time; | ||
1617 | struct udf_sb_info *sbi = UDF_SB(sb); | 1615 | struct udf_sb_info *sbi = UDF_SB(sb); |
1618 | struct buffer_head *bh = sbi->s_lvid_bh; | 1616 | struct buffer_head *bh = sbi->s_lvid_bh; |
1619 | struct logicalVolIntegrityDesc *lvid; | 1617 | struct logicalVolIntegrityDesc *lvid; |
@@ -1628,8 +1626,8 @@ static void udf_close_lvid(struct super_block *sb) | |||
1628 | udf_sb_lvidiu(sbi); | 1626 | udf_sb_lvidiu(sbi); |
1629 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; | 1627 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; |
1630 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; | 1628 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; |
1631 | if (udf_time_to_stamp(&cpu_time, CURRENT_TIME)) | 1629 | udf_time_to_disk_stamp(&lvid->recordingDateAndTime, |
1632 | lvid->recordingDateAndTime = cpu_to_lets(cpu_time); | 1630 | CURRENT_TIME); |
1633 | if (UDF_MAX_WRITE_VERSION > le16_to_cpu(lvidiu->maxUDFWriteRev)) | 1631 | if (UDF_MAX_WRITE_VERSION > le16_to_cpu(lvidiu->maxUDFWriteRev)) |
1634 | lvidiu->maxUDFWriteRev = | 1632 | lvidiu->maxUDFWriteRev = |
1635 | cpu_to_le16(UDF_MAX_WRITE_VERSION); | 1633 | cpu_to_le16(UDF_MAX_WRITE_VERSION); |
@@ -1801,12 +1799,12 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
1801 | } | 1799 | } |
1802 | 1800 | ||
1803 | if (!silent) { | 1801 | if (!silent) { |
1804 | kernel_timestamp ts; | 1802 | timestamp ts; |
1805 | udf_time_to_stamp(&ts, sbi->s_record_time); | 1803 | udf_time_to_disk_stamp(&ts, sbi->s_record_time); |
1806 | udf_info("UDF: Mounting volume '%s', " | 1804 | udf_info("UDF: Mounting volume '%s', " |
1807 | "timestamp %04u/%02u/%02u %02u:%02u (%x)\n", | 1805 | "timestamp %04u/%02u/%02u %02u:%02u (%x)\n", |
1808 | sbi->s_volume_ident, ts.year, ts.month, ts.day, | 1806 | sbi->s_volume_ident, le16_to_cpu(ts.year), ts.month, ts.day, |
1809 | ts.hour, ts.minute, ts.typeAndTimezone); | 1807 | ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone)); |
1810 | } | 1808 | } |
1811 | if (!(sb->s_flags & MS_RDONLY)) | 1809 | if (!(sb->s_flags & MS_RDONLY)) |
1812 | udf_open_lvid(sb); | 1810 | udf_open_lvid(sb); |