summaryrefslogtreecommitdiff
path: root/system/cdfs/cdfs-3.3.diff
blob: c73f6338b0716510c0f2d4842957d3ff6b21ea1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
 Makefile |   14 +++++---------
 cddata.c |    2 +-
 proc.c   |    6 +++---
 root.c   |   25 +++++++++++--------------
 4 files changed, 20 insertions(+), 27 deletions(-)

Index: cdfs-2.6.27/Makefile
===================================================================
--- cdfs-2.6.27.orig/Makefile
+++ cdfs-2.6.27/Makefile
@@ -1,18 +1,14 @@
-ifneq ($(KERNELRELEASE),)
 obj-m := cdfs.o
 cdfs-objs := root.o audio.o cdXA.o cddata.o hfs.o iso.o proc.o root.o utils.o daemon.o discid.o toc.o
 
-else
 KDIR        := /lib/modules/$(shell uname -r)/build
 PWD         := $(shell pwd)
 
-all:
-	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-
-install:
-	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules_install
-endif
+all modules:
+	$(MAKE) -C $(KDIR) M=$(PWD) modules
 
+install modules_install:
+	$(MAKE) -C $(KDIR) M=$(PWD) modules_install
 
 clean:
-	-rm *.o *.ko .*.cmd *.mod.c *~
+	$(MAKE) -C $(KDIR) M=$(PWD) clean
Index: cdfs-2.6.27/cddata.c
===================================================================
--- cdfs-2.6.27.orig/cddata.c
+++ cdfs-2.6.27/cddata.c
@@ -108,7 +108,7 @@ int cdfs_read_rawDATA_frame(struct super
   bh=cdfs_bread(sb, lba, CD_FRAMESIZE);
   if (!bh) {
     // dit gebeurt indien track1!=ISO is, bv. De Morgen CD
-    printk("cdfs_read_rawDATA(%x, %u, %x) FAILED!\n", (unsigned)sb, lba, (unsigned)buf);
+    printk("cdfs_read_rawDATA(%lx, %u, %lx) FAILED!\n", (unsigned long)sb, lba, (unsigned long)buf);
   } else {
     memcpy(buf, bh->b_data, CD_FRAMESIZE);
     brelse(bh);
Index: cdfs-2.6.27/proc.c
===================================================================
--- cdfs-2.6.27.orig/proc.c
+++ cdfs-2.6.27/proc.c
@@ -262,7 +262,7 @@ cdfs_show(struct seq_file *file_p, void
 	if (track_p->iso_size) {
 	    seq_printf(
 		file_p,
-		"Track %2d: data track (%s), [%d-%d/%d], length=%d MB\n",
+		"Track %2ld: data track (%s), [%d-%d/%d], length=%d MB\n",
 		TRACK_POINTER_TO_TRACK_NUMBER(track_p),
 		track_p->name,
 		track_p->start_lba,
@@ -313,7 +313,7 @@ cdfs_show(struct seq_file *file_p, void
 	} else {
 	    seq_printf(
 		file_p,
-		"Track %2d: data track (%s), [%d-%d], length=%d kB\n",
+		"Track %2ld: data track (%s), [%d-%d], length=%d kB\n",
 		TRACK_POINTER_TO_TRACK_NUMBER(track_p),
 		track_p->name,
 		track_p->start_lba,
@@ -362,7 +362,7 @@ cdfs_show(struct seq_file *file_p, void
 	cdfs_constructMSFsize(MSFsize, track_p->size);
 	seq_printf(
 	    file_p,
-	    "Track %2d: audio track (%s), [%8d -%8d], length=%s\n",
+	    "Track %2ld: audio track (%s), [%8d -%8d], length=%s\n",
 	    TRACK_POINTER_TO_TRACK_NUMBER(track_p),
 	    track_p->name,
 	    track_p->start_lba,
Index: cdfs-2.6.27/root.c
===================================================================
--- cdfs-2.6.27.orig/root.c
+++ cdfs-2.6.27/root.c
@@ -25,6 +25,7 @@
 #include "cdfs.h"
 
 #include <linux/module.h>
+#include <linux/sched.h>
 
 
 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
@@ -375,7 +376,9 @@ out:
 
   PRINT("retinode = %ld\n", retinode->i_ino);
 
-  sb->s_root   = d_alloc_root(retinode);
+  sb->s_root   = d_make_root(retinode);
+  if (sb->s_root != NULL)
+  	return -ENOMEM;
 
   cdfs_proc_cd = this_cd;
 
@@ -517,7 +520,7 @@ static void cdfs_read_inode(struct inode
   
   i->i_uid        = this_cd->uid;
   i->i_gid        = this_cd->gid;
-  i->i_nlink      = 1;
+  set_nlink(i, 1);
   i->i_op         = &cdfs_inode_operations;
   i->i_fop        = NULL;
   i->i_data.a_ops = NULL;
@@ -594,26 +597,20 @@ static struct super_operations cdfs_ops
   .statfs     = cdfs_statfs
 };
 
-#ifdef OLD_KERNEL
-static DECLARE_FSTYPE_DEV(cdfs_fs_type, FSNAME, cdfs_mount);
-#else
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
-static int cdfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) {
-  return get_sb_bdev(fs_type, flags, dev_name, data, cdfs_fill_super, mnt);
-#else
-static struct super_block *cdfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) {
-  return get_sb_bdev(fs_type, flags, dev_name, data, cdfs_fill_super);
-#endif
+static struct dentry *
+cdfs_mount_modern(struct file_system_type *fstype, int flags,
+                  const char *dev_name, void *data)
+{
+	return mount_bdev(fstype, flags, dev_name, data, cdfs_fill_super);
 }
 
 static struct file_system_type cdfs_fs_type = {
   .owner    = THIS_MODULE,
   .name     = "cdfs",
-  .get_sb   = cdfs_get_sb,
+  .mount    = cdfs_mount_modern,
   .kill_sb  = kill_block_super,
   .fs_flags = FS_REQUIRES_DEV
 };
-#endif
 
 /******************************************************/