linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] fs/hpfs/*: fix HPFS support under 64-bit kernel
@ 2005-03-20  1:52 Max
  0 siblings, 0 replies; 3+ messages in thread
From: Max @ 2005-03-20  1:52 UTC (permalink / raw)
  To: linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

The following patch fixes HPFS filesystem support under 64-bit Linux kernel and closes the bugreport http://bugme.osdl.org/show_bug.cgi?id=4333
The problem is in 'time_t' size which is 8 bytes on 64-bit systems (comparing to 4 bytes on 32-bit systems). The patch introduces local 'time32_t' type of the fixed size 4 and uses it where required.

Regards,
Max


[-- Attachment #2: hpfs_fix.diff --]
[-- Type: text/x-patch, Size: 2309 bytes --]

diff -u old/fs/hpfs/hpfs_fn.h fs/hpfs/hpfs_fn.h
--- old/fs/hpfs/hpfs_fn.h	2005-03-04 09:26:36.000000000 -0800
+++ fs/hpfs/hpfs_fn.h	2005-03-14 09:10:16.040399536 -0800
@@ -329,13 +329,13 @@
  * local time (HPFS) to GMT (Unix)
  */
 
-static inline time_t local_to_gmt(struct super_block *s, time_t t)
+static inline time_t local_to_gmt(struct super_block *s, time32_t t)
 {
 	extern struct timezone sys_tz;
 	return t + sys_tz.tz_minuteswest * 60 + hpfs_sb(s)->sb_timeshift;
 }
 
-static inline time_t gmt_to_local(struct super_block *s, time_t t)
+static inline time32_t gmt_to_local(struct super_block *s, time_t t)
 {
 	extern struct timezone sys_tz;
 	return t - sys_tz.tz_minuteswest * 60 - hpfs_sb(s)->sb_timeshift;
diff -u old/fs/hpfs/hpfs.h fs/hpfs/hpfs.h
--- old/fs/hpfs/hpfs.h	2005-03-04 09:26:46.000000000 -0800
+++ fs/hpfs/hpfs.h	2005-03-14 09:11:59.884612816 -0800
@@ -27,6 +27,8 @@
 typedef secno fnode_secno;		/* sector number of an fnode */
 typedef secno anode_secno;		/* sector number of an anode */
 
+typedef unsigned time32_t;		/* 32-bit time_t type */
+
 /* sector 0 */
 
 /* The boot block is very like a FAT boot block, except that the
@@ -84,9 +86,9 @@
   unsigned zero1;			/* 0 */
   secno badblocks;			/* bad block list */
   unsigned zero3;			/* 0 */
-  time_t last_chkdsk;			/* date last checked, 0 if never */
+  time32_t last_chkdsk;			/* date last checked, 0 if never */
   /*unsigned zero4;*/			/* 0 */
-  time_t last_optimize;			/* date last optimized, 0 if never */
+  time32_t last_optimize;			/* date last optimized, 0 if never */
   secno n_dir_band;			/* number of sectors in dir band */
   secno dir_band_start;			/* first sector in dir band */
   secno dir_band_end;			/* last sector in dir band */
@@ -287,10 +289,10 @@
   unsigned not_8x3: 1;			/* name is not 8.3 */
   unsigned flag15: 1;
   fnode_secno fnode;			/* fnode giving allocation info */
-  time_t write_date;			/* mtime */
+  time32_t write_date;			/* mtime */
   unsigned file_size;			/* file length, bytes */
-  time_t read_date;			/* atime */
-  time_t creation_date;			/* ctime */
+  time32_t read_date;			/* atime */
+  time32_t creation_date;			/* ctime */
   unsigned ea_size;			/* total EA length, bytes */
   unsigned char no_of_acls : 3;		/* number of ACL's */
   unsigned char reserver : 5;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] fs/hpfs/*: fix HPFS support under 64-bit kernel
@ 2005-03-20  5:11 Stephen Rothwell
  2005-03-20  5:24 ` Max
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2005-03-20  5:11 UTC (permalink / raw)
  To: linux-fsdevel, relf

From: Max <relf@unn.ac.ru>
> 
> diff -u old/fs/hpfs/hpfs.h fs/hpfs/hpfs.h
> --- old/fs/hpfs/hpfs.h	2005-03-04 09:26:46.000000000 -0800
> +++ fs/hpfs/hpfs.h	2005-03-14 09:11:59.884612816 -0800
> @@ -27,6 +27,8 @@
>  typedef secno fnode_secno;		/* sector number of an fnode */
>  typedef secno anode_secno;		/* sector number of an anode */
>  
> +typedef unsigned time32_t;		/* 32-bit time_t type */

Please use u32 instead of unsigned as u32 will *always* be an
unsigned 32 bit quantity ...

Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] fs/hpfs/*: fix HPFS support under 64-bit kernel
  2005-03-20  5:11 [patch] fs/hpfs/*: fix HPFS support under 64-bit kernel Stephen Rothwell
@ 2005-03-20  5:24 ` Max
  0 siblings, 0 replies; 3+ messages in thread
From: Max @ 2005-03-20  5:24 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-fsdevel

Stephen,

I've made my patch compatible with the rest of HPFS sources. There is a lot of places where 'unsigned' has to be precisely 32 bits long.
So having 'u32' just in my small patch does not make much sense.

Max

Stephen Rothwell wrote:
> From: Max <relf@unn.ac.ru>
> 
>>diff -u old/fs/hpfs/hpfs.h fs/hpfs/hpfs.h
>>--- old/fs/hpfs/hpfs.h	2005-03-04 09:26:46.000000000 -0800
>>+++ fs/hpfs/hpfs.h	2005-03-14 09:11:59.884612816 -0800
>>@@ -27,6 +27,8 @@
>> typedef secno fnode_secno;		/* sector number of an fnode */
>> typedef secno anode_secno;		/* sector number of an anode */
>> 
>>+typedef unsigned time32_t;		/* 32-bit time_t type */
> 
> 
> Please use u32 instead of unsigned as u32 will *always* be an
> unsigned 32 bit quantity ...
> 
> Cheers,
> Stephen Rothwell
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-20  5:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-20  5:11 [patch] fs/hpfs/*: fix HPFS support under 64-bit kernel Stephen Rothwell
2005-03-20  5:24 ` Max
  -- strict thread matches above, loose matches on Subject: below --
2005-03-20  1:52 Max

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).