aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-02 14:34:06 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:33 -0400
commitb0b0382bb4904965a9e9fca77ad87514dfda0d1c (patch)
treedc46873fa74e0d194e4a2571b16f0767e1919ae8 /fs/ocfs2
parent6d42e7e9f6d86ed4dfacde75a6cf515068f9749c (diff)
->encode_fh() API change
pass inode + parent's inode or NULL instead of dentry + bool saying whether we want the parent or not. NOTE: that needs ceph fix folded in. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/export.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index 745db42528d5..322216a5f0dd 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -177,21 +177,23 @@ bail:
177 return parent; 177 return parent;
178} 178}
179 179
180static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, 180static int ocfs2_encode_fh(struct inode *inode, u32 *fh_in, int *max_len,
181 int connectable) 181 struct inode *parent)
182{ 182{
183 struct inode *inode = dentry->d_inode;
184 int len = *max_len; 183 int len = *max_len;
185 int type = 1; 184 int type = 1;
186 u64 blkno; 185 u64 blkno;
187 u32 generation; 186 u32 generation;
188 __le32 *fh = (__force __le32 *) fh_in; 187 __le32 *fh = (__force __le32 *) fh_in;
189 188
189#ifdef TRACE_HOOKS_ARE_NOT_BRAINDEAD_IN_YOUR_OPINION
190#error "You go ahead and fix that mess, then. Somehow"
190 trace_ocfs2_encode_fh_begin(dentry, dentry->d_name.len, 191 trace_ocfs2_encode_fh_begin(dentry, dentry->d_name.len,
191 dentry->d_name.name, 192 dentry->d_name.name,
192 fh, len, connectable); 193 fh, len, connectable);
194#endif
193 195
194 if (connectable && (len < 6)) { 196 if (parent && (len < 6)) {
195 *max_len = 6; 197 *max_len = 6;
196 type = 255; 198 type = 255;
197 goto bail; 199 goto bail;
@@ -211,12 +213,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
211 fh[1] = cpu_to_le32((u32)(blkno & 0xffffffff)); 213 fh[1] = cpu_to_le32((u32)(blkno & 0xffffffff));
212 fh[2] = cpu_to_le32(generation); 214 fh[2] = cpu_to_le32(generation);
213 215
214 if (connectable && !S_ISDIR(inode->i_mode)) { 216 if (parent) {
215 struct inode *parent;
216
217 spin_lock(&dentry->d_lock);
218
219 parent = dentry->d_parent->d_inode;
220 blkno = OCFS2_I(parent)->ip_blkno; 217 blkno = OCFS2_I(parent)->ip_blkno;
221 generation = parent->i_generation; 218 generation = parent->i_generation;
222 219
@@ -224,8 +221,6 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
224 fh[4] = cpu_to_le32((u32)(blkno & 0xffffffff)); 221 fh[4] = cpu_to_le32((u32)(blkno & 0xffffffff));
225 fh[5] = cpu_to_le32(generation); 222 fh[5] = cpu_to_le32(generation);
226 223
227 spin_unlock(&dentry->d_lock);
228
229 len = 6; 224 len = 6;
230 type = 2; 225 type = 2;
231 226