diff options
Diffstat (limited to 'fs/isofs/export.c')
-rw-r--r-- | fs/isofs/export.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/isofs/export.c b/fs/isofs/export.c index dd4687ff30d0..aa4356d09eee 100644 --- a/fs/isofs/export.c +++ b/fs/isofs/export.c | |||
@@ -107,12 +107,11 @@ static struct dentry *isofs_export_get_parent(struct dentry *child) | |||
107 | } | 107 | } |
108 | 108 | ||
109 | static int | 109 | static int |
110 | isofs_export_encode_fh(struct dentry *dentry, | 110 | isofs_export_encode_fh(struct inode *inode, |
111 | __u32 *fh32, | 111 | __u32 *fh32, |
112 | int *max_len, | 112 | int *max_len, |
113 | int connectable) | 113 | struct inode *parent) |
114 | { | 114 | { |
115 | struct inode * inode = dentry->d_inode; | ||
116 | struct iso_inode_info * ei = ISOFS_I(inode); | 115 | struct iso_inode_info * ei = ISOFS_I(inode); |
117 | int len = *max_len; | 116 | int len = *max_len; |
118 | int type = 1; | 117 | int type = 1; |
@@ -124,7 +123,7 @@ isofs_export_encode_fh(struct dentry *dentry, | |||
124 | * offset of the inode and the upper 16 bits of fh32[1] to | 123 | * offset of the inode and the upper 16 bits of fh32[1] to |
125 | * hold the offset of the parent. | 124 | * hold the offset of the parent. |
126 | */ | 125 | */ |
127 | if (connectable && (len < 5)) { | 126 | if (parent && (len < 5)) { |
128 | *max_len = 5; | 127 | *max_len = 5; |
129 | return 255; | 128 | return 255; |
130 | } else if (len < 3) { | 129 | } else if (len < 3) { |
@@ -136,16 +135,12 @@ isofs_export_encode_fh(struct dentry *dentry, | |||
136 | fh32[0] = ei->i_iget5_block; | 135 | fh32[0] = ei->i_iget5_block; |
137 | fh16[2] = (__u16)ei->i_iget5_offset; /* fh16 [sic] */ | 136 | fh16[2] = (__u16)ei->i_iget5_offset; /* fh16 [sic] */ |
138 | fh32[2] = inode->i_generation; | 137 | fh32[2] = inode->i_generation; |
139 | if (connectable && !S_ISDIR(inode->i_mode)) { | 138 | if (parent) { |
140 | struct inode *parent; | ||
141 | struct iso_inode_info *eparent; | 139 | struct iso_inode_info *eparent; |
142 | spin_lock(&dentry->d_lock); | ||
143 | parent = dentry->d_parent->d_inode; | ||
144 | eparent = ISOFS_I(parent); | 140 | eparent = ISOFS_I(parent); |
145 | fh32[3] = eparent->i_iget5_block; | 141 | fh32[3] = eparent->i_iget5_block; |
146 | fh16[3] = (__u16)eparent->i_iget5_offset; /* fh16 [sic] */ | 142 | fh16[3] = (__u16)eparent->i_iget5_offset; /* fh16 [sic] */ |
147 | fh32[4] = parent->i_generation; | 143 | fh32[4] = parent->i_generation; |
148 | spin_unlock(&dentry->d_lock); | ||
149 | len = 5; | 144 | len = 5; |
150 | type = 2; | 145 | type = 2; |
151 | } | 146 | } |