@@ -79,10 +79,7 @@ impl FileSystem for Vfs {
79
79
// parent is in an underlying rootfs
80
80
let mut entry = fs. lookup ( ctx, idata. ino ( ) , name) ?;
81
81
// lookup success, hash it to a real fuse inode
82
- let new_ino = self . convert_inode ( idata. fs_idx ( ) , entry. inode ) ?;
83
- entry. inode = new_ino;
84
- entry. attr . st_ino = new_ino;
85
- Ok ( entry)
82
+ self . convert_entry ( idata. fs_idx ( ) , entry. inode , & mut entry)
86
83
}
87
84
}
88
85
}
@@ -155,10 +152,9 @@ impl FileSystem for Vfs {
155
152
156
153
match self . get_real_rootfs ( parent) ? {
157
154
( Left ( fs) , idata) => fs. symlink ( ctx, linkname, idata. ino ( ) , name) ,
158
- ( Right ( fs) , idata) => fs. symlink ( ctx, linkname, idata. ino ( ) , name) . map ( |mut e| {
159
- e. inode = self . convert_inode ( idata. fs_idx ( ) , e. inode ) ?;
160
- Ok ( e)
161
- } ) ?,
155
+ ( Right ( fs) , idata) => fs
156
+ . symlink ( ctx, linkname, idata. ino ( ) , name)
157
+ . map ( |mut e| self . convert_entry ( idata. fs_idx ( ) , e. inode , & mut e) ) ?,
162
158
}
163
159
}
164
160
@@ -175,13 +171,9 @@ impl FileSystem for Vfs {
175
171
176
172
match self . get_real_rootfs ( inode) ? {
177
173
( Left ( fs) , idata) => fs. mknod ( ctx, idata. ino ( ) , name, mode, rdev, umask) ,
178
- ( Right ( fs) , idata) => {
179
- fs. mknod ( ctx, idata. ino ( ) , name, mode, rdev, umask)
180
- . map ( |mut e| {
181
- e. inode = self . convert_inode ( idata. fs_idx ( ) , e. inode ) ?;
182
- Ok ( e)
183
- } ) ?
184
- }
174
+ ( Right ( fs) , idata) => fs
175
+ . mknod ( ctx, idata. ino ( ) , name, mode, rdev, umask)
176
+ . map ( |mut e| self . convert_entry ( idata. fs_idx ( ) , e. inode , & mut e) ) ?,
185
177
}
186
178
}
187
179
@@ -197,10 +189,9 @@ impl FileSystem for Vfs {
197
189
198
190
match self . get_real_rootfs ( parent) ? {
199
191
( Left ( fs) , idata) => fs. mkdir ( ctx, idata. ino ( ) , name, mode, umask) ,
200
- ( Right ( fs) , idata) => fs. mkdir ( ctx, idata. ino ( ) , name, mode, umask) . map ( |mut e| {
201
- e. inode = self . convert_inode ( idata. fs_idx ( ) , e. inode ) ?;
202
- Ok ( e)
203
- } ) ?,
192
+ ( Right ( fs) , idata) => fs
193
+ . mkdir ( ctx, idata. ino ( ) , name, mode, umask)
194
+ . map ( |mut e| self . convert_entry ( idata. fs_idx ( ) , e. inode , & mut e) ) ?,
204
195
}
205
196
}
206
197
@@ -281,10 +272,7 @@ impl FileSystem for Vfs {
281
272
Left ( fs) => fs. link ( ctx, idata_old. ino ( ) , idata_new. ino ( ) , newname) ,
282
273
Right ( fs) => fs
283
274
. link ( ctx, idata_old. ino ( ) , idata_new. ino ( ) , newname)
284
- . map ( |mut e| {
285
- e. inode = self . convert_inode ( idata_new. fs_idx ( ) , e. inode ) ?;
286
- Ok ( e)
287
- } ) ?,
275
+ . map ( |mut e| self . convert_entry ( idata_new. fs_idx ( ) , e. inode , & mut e) ) ?,
288
276
}
289
277
}
290
278
@@ -321,7 +309,7 @@ impl FileSystem for Vfs {
321
309
( Right ( fs) , idata) => {
322
310
fs. create ( ctx, idata. ino ( ) , name, args)
323
311
. map ( |( mut a, b, c) | {
324
- a . inode = self . convert_inode ( idata. fs_idx ( ) , a. inode ) ?;
312
+ self . convert_entry ( idata. fs_idx ( ) , a. inode , & mut a ) ?;
325
313
Ok ( ( a, b, c) )
326
314
} ) ?
327
315
}
0 commit comments