vserver 1.9.3
[linux-2.6.git] / fs / fat / misc.c
index 413a414..85a85ec 100644 (file)
@@ -73,9 +73,9 @@ void fat_clusters_flush(struct super_block *sb)
                       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);
@@ -243,8 +243,7 @@ int date_dos2unix(unsigned short time,unsigned short date)
 
 /* 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;
 
@@ -254,8 +253,8 @@ void fat_date_unix2dos(int unix_date,unsigned short *time,
        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--;
@@ -269,7 +268,7 @@ void fat_date_unix2dos(int unix_date,unsigned short *time,
                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));
 }