@@ -149,11 +149,11 @@ const createRequestFactory = findMountpoint => (getter, method, readOnly, respon
149149 const { attributes} = found . mount ;
150150 const strict = attributes . strictGroups !== false ;
151151 const ranges = ( ! attributes . adapter || attributes . adapter === 'system' ) || attributes . ranges === true ;
152- const wrapper = m => found . adapter [ m ] ( { adapter : found . adapter , mount : found . mount } ) ( ...args ) ;
153- const readstat = ( ) => wrapper ( 'stat' ) . catch ( ( ) => ( { } ) ) ;
152+ const vfsMethodWrapper = m => found . adapter [ m ] ( found ) ( ...args ) ;
153+ const readstat = ( ) => vfsMethodWrapper ( 'stat' ) . catch ( ( ) => ( { } ) ) ;
154154 await checkMountpointPermission ( req , res , method , readOnly , strict ) ( found ) ;
155155
156- const result = await wrapper ( method ) ;
156+ const result = await vfsMethodWrapper ( method ) ;
157157 if ( method === 'readfile' ) {
158158 const stat = await readstat ( ) ;
159159
@@ -195,7 +195,6 @@ const createCrossRequestFactory = findMountpoint => (getter, method, respond) =>
195195 const srcMount = await findMountpoint ( from ) ;
196196 const destMount = await findMountpoint ( to ) ;
197197 const sameAdapter = srcMount . adapter === destMount . adapter ;
198- const createArgs = t => ( { adapter : t . adapter , mount : t . mount } ) ;
199198
200199 const srcStrict = srcMount . mount . attributes . strictGroups !== false ;
201200 const destStrict = destMount . mount . attributes . strictGroups !== false ;
@@ -204,21 +203,21 @@ const createCrossRequestFactory = findMountpoint => (getter, method, respond) =>
204203
205204 if ( sameAdapter ) {
206205 const result = await srcMount
207- . adapter [ method ] ( createArgs ( srcMount ) , createArgs ( destMount ) ) ( from , to , options ) ;
206+ . adapter [ method ] ( srcMount , destMount ) ( from , to , options ) ;
208207
209208 return ! ! result ;
210209 }
211210
212211 // Simulates a copy/move
213212 const stream = await srcMount . adapter
214- . readfile ( createArgs ( srcMount ) ) ( from , options ) ;
213+ . readfile ( srcMount ) ( from , options ) ;
215214
216215 const result = await destMount . adapter
217- . writefile ( createArgs ( destMount ) ) ( to , stream , options ) ;
216+ . writefile ( destMount ) ( to , stream , options ) ;
218217
219218 if ( method === 'rename' ) {
220219 await srcMount . adapter
221- . unlink ( createArgs ( srcMount ) ) ( from , options ) ;
220+ . unlink ( srcMount ) ( from , options ) ;
222221 }
223222
224223 return ! ! result ;
0 commit comments