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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.c cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.c
--- cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.c 2008-02-26 16:37:43.000000000 +0100
+++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.c 2008-03-21 03:01:29.000000000 +0100
@@ -44,6 +44,49 @@
};
/**
+ * gfs_decode_fh -
+ * @param1: description
+ * @param2: description
+ * @param3: description
+ *
+ * Function description
+ *
+ * Returns: what is returned
+ */
+
+struct dentry *
+gfs_decode_fh(struct super_block *sb, __u32 *fh, int fh_len, int fh_type,
+ int (*acceptable)(void *context, struct dentry *dentry),
+ void *context)
+{
+ struct inode_cookie this, parent;
+
+ atomic_inc(&get_v2sdp(sb)->sd_ops_export);
+
+ memset(&parent, 0, sizeof(struct inode_cookie));
+
+ switch (fh_type) {
+ case 6:
+ parent.gen_valid = TRUE;
+ parent.gen = gfs32_to_cpu(fh[5]);
+ case 5:
+ parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32;
+ parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]);
+ case 3:
+ this.gen_valid = TRUE;
+ this.gen = gfs32_to_cpu(fh[2]);
+ this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32;
+ this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]);
+ break;
+ default:
+ return NULL;
+ }
+
+ return gfs_export_ops.find_exported_dentry(sb, &this, &parent,
+ acceptable, context);
+}
+
+/**
* gfs_encode_fh -
* @param1: description
* @param2: description
@@ -247,9 +290,10 @@
*/
struct dentry *
-gfs_get_dentry(struct super_block *sb, struct inode_cookie *cookie)
+gfs_get_dentry(struct super_block *sb, void *inump)
{
struct gfs_sbd *sdp = get_v2sdp(sb);
+ struct inode_cookie *cookie = (struct inode_cookie *)inump;
struct gfs_inum inum;
struct gfs_holder i_gh, ri_gh, rgd_gh;
struct gfs_rgrpd *rgd;
@@ -362,55 +406,11 @@
return ERR_PTR(error);
}
-static struct dentry *gfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
- int fh_len, int fh_type)
-{
- struct inode_cookie this;
- __u32 *fh = fid->raw;
-
- atomic_inc(&get_v2sdp(sb)->sd_ops_export);
-
- switch (fh_type) {
- case 6:
- case 5:
- case 3:
- this.gen_valid = TRUE;
- this.gen = gfs32_to_cpu(fh[2]);
- this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32;
- this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]);
- return gfs_get_dentry(sb, &this);
- default:
- return NULL;
- }
-}
-
-static struct dentry *gfs_fh_to_parent(struct super_block *sb, struct fid *fid,
- int fh_len, int fh_type)
-{
- struct inode_cookie parent;
- __u32 *fh = fid->raw;
-
- atomic_inc(&get_v2sdp(sb)->sd_ops_export);
-
- switch (fh_type) {
- case 6:
- parent.gen_valid = TRUE;
- parent.gen = gfs32_to_cpu(fh[5]);
- case 5:
- parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32;
- parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]);
- default:
- return NULL;
- }
-
- return gfs_get_dentry(sb, &parent);
-}
-
-const struct export_operations gfs_export_ops = {
+struct export_operations gfs_export_ops = {
+ .decode_fh = gfs_decode_fh,
.encode_fh = gfs_encode_fh,
- .fh_to_dentry = gfs_fh_to_dentry,
- .fh_to_parent = gfs_fh_to_parent,
.get_name = gfs_get_name,
.get_parent = gfs_get_parent,
+ .get_dentry = gfs_get_dentry,
};
diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.h cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.h
--- cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_export.h 2008-02-26 16:37:43.000000000 +0100
+++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_export.h 2008-03-21 03:01:29.000000000 +0100
@@ -14,6 +14,6 @@
#ifndef __OPS_EXPORT_DOT_H__
#define __OPS_EXPORT_DOT_H__
-extern const struct export_operations gfs_export_ops;
+extern struct export_operations gfs_export_ops;
#endif /* __OPS_EXPORT_DOT_H__ */
diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_vm.c cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_vm.c
--- cluster-2.02.00.orig/gfs-kernel/src/gfs/ops_vm.c 2008-02-26 16:37:43.000000000 +0100
+++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/ops_vm.c 2008-03-21 03:01:29.000000000 +0100
@@ -94,10 +94,9 @@
*/
static int
-alloc_page_backing(struct gfs_inode *ip, struct page *page)
+alloc_page_backing(struct gfs_inode *ip, unsigned long index)
{
struct gfs_sbd *sdp = ip->i_sbd;
- unsigned long index = page->index;
uint64_t lblock = index << (PAGE_CACHE_SHIFT - sdp->sd_sb.sb_bsize_shift);
unsigned int blocks = PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift;
struct gfs_alloc *al;
@@ -180,7 +179,8 @@
struct vm_fault *vmf)
{
struct file *file = vma->vm_file;
- struct gfs_inode *ip = get_v2ip(file->f_mapping->host);
+ struct gfs_file *gf = file->private_data;
+ struct gfs_inode *ip = get_v2ip(vma->vm_file->f_mapping->host);
struct gfs_holder i_gh;
int alloc_required;
int error;
diff -uNr cluster-2.02.00.orig/gfs-kernel/src/gfs/sys.c cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/sys.c
--- cluster-2.02.00.orig/gfs-kernel/src/gfs/sys.c 2008-02-26 16:37:43.000000000 +0100
+++ cluster-2.02.00-2.6.23/gfs-kernel/src/gfs/sys.c 2008-03-21 03:01:29.000000000 +0100
@@ -86,6 +86,7 @@
};
static struct kset gfs_kset = {
+ .kobj = {.name = "gfs",},
.ktype = &gfs_ktype,
};
@@ -119,7 +120,6 @@
{
gfs_sys_margs = NULL;
spin_lock_init(&gfs_sys_margs_lock);
- kobject_set_name(&gfs_kset.kobj, "gfs");
kobj_set_kset_s(&gfs_kset, fs_subsys);
return kset_register(&gfs_kset);
}
|