Re: [ANNOUNCE] HFS+ driver

"David S. Miller" <[email protected]> 07 May 2003 08:40:35 -0700
Newsgroups gmane.linux.file-systems.hfsplus.devel,gmane.linux.file-systems,gmane.linux.kernel
Message-ID <[email protected]>
On Wed, 2003-05-07 at 08:06, Roman Zippel wrote:
> The driver can be downloaded from http://www.ardistech.com/hfsplus/ .
> The README describes how to build the driver.

This patch fixes 64-bit bugs (in extent code) and warnings
(in directory handling).

-- 
David S. Miller <[email protected]>
diff (text/plain, 2.2 KB)
--- extents.c.~1~	Fri May  2 04:25:09 2003
+++ extents.c	Wed May  7 08:34:55 2003
@@ -216,7 +216,7 @@
 					break;
 			}
 			data[off] = cpu_to_be32(~word);
-			m = 1 << (8 * sizeof(unsigned long) - 1);
+			m = 1UL << (8 * sizeof(unsigned long) - 1);
 		} while (++off < size);
 	done:
 		mark_buffer_dirty_inode(bh, anode);
@@ -341,7 +341,7 @@
 			word = be32_to_cpu(data[off]);
 			if (!~word)
 				continue;
-			m = 1 << (sizeof(unsigned long) * 8 - 1);
+			m = 1UL << (sizeof(unsigned long) * 8 - 1);
 			for (i = 0; m; i++, m >>= 1) {
 				if (word & m)
 					continue;
--- dir.c.~1~	Fri May  2 07:32:04 2003
+++ dir.c	Wed May  7 08:36:06 2003
@@ -69,14 +69,14 @@
 				inode = NULL;
 				goto out;
 			}
-			dentry->d_fsdata = (void *)cnid;
+			dentry->d_fsdata = (void *)(unsigned long)cnid;
 			linkid = be32_to_cpu(entry.file.permissions.dev);
 			str.len = sprintf(name, "iNode%d", linkid);
 			str.name = name;
 			hfsplus_fill_cat_key(fd.search_key, HFSPLUS_SB(sb).hidden_dir->i_ino, &str);
 			goto again;
 		} else if (!dentry->d_fsdata)
-			dentry->d_fsdata = (void *)cnid;
+			dentry->d_fsdata = (void *)(unsigned long)cnid;
 	} else {
 		printk("HFS+-fs: Illegal catalog entry type in lookup\n");
 		err = -EIO;
@@ -267,7 +267,7 @@
 	if (HFSPLUS_IS_RSRC(inode))
 		return -EPERM;
 
-	if (inode->i_ino == (u32)src_dentry->d_fsdata) {
+	if (inode->i_ino == (u32)(unsigned long)src_dentry->d_fsdata) {
 		for (;;) {
 			get_random_bytes(&id, sizeof(cnid));
 			id &= 0x3fffffff;
@@ -283,7 +283,7 @@
 		}
 		HFSPLUS_I(inode).dev = id;
 		cnid = HFSPLUS_SB(sb).next_cnid++;
-		src_dentry->d_fsdata = (void *)cnid;
+		src_dentry->d_fsdata = (void *)(unsigned long)cnid;
 		res = hfsplus_create_cat(cnid, src_dir, &src_dentry->d_name, inode);
 		if (res)
 			/* panic? */
@@ -296,7 +296,7 @@
 		return res;
 
 	inode->i_nlink++;
-	dst_dentry->d_fsdata = (void *)cnid;
+	dst_dentry->d_fsdata = (void *)(unsigned long)cnid;
 	d_instantiate(dst_dentry, inode);
 	atomic_inc(&inode->i_count);
 	inode->i_ctime = CURRENT_TIME;
@@ -319,7 +319,7 @@
 	if (HFSPLUS_IS_RSRC(inode))
 		return -EPERM;
 
-	cnid = (u32)dentry->d_fsdata;
+	cnid = (u32)(unsigned long)dentry->d_fsdata;
 	if (inode->i_ino == cnid &&
 	    atomic_read(&HFSPLUS_I(inode).opencnt)) {
 		str.name = name;