sbi->fsinfo_sector);
} else {
if (sbi->free_clusters != -1)
- fsinfo->free_clusters = CF_LE_L(sbi->free_clusters);
+ fsinfo->free_clusters = cpu_to_le32(sbi->free_clusters);
if (sbi->prev_free != -1)
- fsinfo->next_cluster = CF_LE_L(sbi->prev_free);
+ fsinfo->next_cluster = cpu_to_le32(sbi->prev_free);
mark_buffer_dirty(bh);
}
brelse(bh);
/* Convert linear UNIX date to a MS-DOS time/date pair. */
-void fat_date_unix2dos(int unix_date,unsigned short *time,
- unsigned short *date)
+void fat_date_unix2dos(int unix_date,__le16 *time, __le16 *date)
{
int day,year,nl_day,month;
if (unix_date < 315532800)
unix_date = 315532800;
- *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+
- (((unix_date/3600) % 24) << 11);
+ *time = cpu_to_le16((unix_date % 60)/2+(((unix_date/60) % 60) << 5)+
+ (((unix_date/3600) % 24) << 11));
day = unix_date/86400-3652;
year = day/365;
if ((year+3)/4+365*year > day) year--;
for (month = 0; month < 12; month++)
if (day_n[month] > nl_day) break;
}
- *date = nl_day-day_n[month-1]+1+(month << 5)+(year << 9);
+ *date = cpu_to_le16(nl_day-day_n[month-1]+1+(month << 5)+(year << 9));
}