@@ -52,7 +52,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
52
52
53
53
dentry = cifs_sb -> root ;
54
54
55
- cfid = tcon -> cfid ;
55
+ cfid = & tcon -> cfids -> cfid ;
56
56
mutex_lock (& cfid -> fid_mutex );
57
57
if (cfid -> is_valid ) {
58
58
cifs_dbg (FYI , "found a cached root file handle\n" );
@@ -226,7 +226,7 @@ int open_cached_dir_by_dentry(struct cifs_tcon *tcon,
226
226
{
227
227
struct cached_fid * cfid ;
228
228
229
- cfid = tcon -> cfid ;
229
+ cfid = & tcon -> cfids -> cfid ;
230
230
231
231
mutex_lock (& cfid -> fid_mutex );
232
232
if (cfid -> dentry == dentry ) {
@@ -320,7 +320,7 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)
320
320
tcon = tlink_tcon (tlink );
321
321
if (IS_ERR (tcon ))
322
322
continue ;
323
- cfid = tcon -> cfid ;
323
+ cfid = & tcon -> cfids -> cfid ;
324
324
mutex_lock (& cfid -> fid_mutex );
325
325
if (cfid -> dentry ) {
326
326
dput (cfid -> dentry );
@@ -336,12 +336,14 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)
336
336
*/
337
337
void invalidate_all_cached_dirs (struct cifs_tcon * tcon )
338
338
{
339
- mutex_lock (& tcon -> cfid -> fid_mutex );
340
- tcon -> cfid -> is_valid = false;
339
+ struct cached_fid * cfid = & tcon -> cfids -> cfid ;
340
+
341
+ mutex_lock (& cfid -> fid_mutex );
342
+ cfid -> is_valid = false;
341
343
/* cached handle is not valid, so SMB2_CLOSE won't be sent below */
342
- close_cached_dir_lease_locked (tcon -> cfid );
343
- memset (& tcon -> cfid -> fid , 0 , sizeof (struct cifs_fid ));
344
- mutex_unlock (& tcon -> cfid -> fid_mutex );
344
+ close_cached_dir_lease_locked (cfid );
345
+ memset (& cfid -> fid , 0 , sizeof (struct cifs_fid ));
346
+ mutex_unlock (& cfid -> fid_mutex );
345
347
}
346
348
347
349
static void
@@ -355,34 +357,36 @@ smb2_cached_lease_break(struct work_struct *work)
355
357
356
358
int cached_dir_lease_break (struct cifs_tcon * tcon , __u8 lease_key [16 ])
357
359
{
358
- if (tcon -> cfid -> is_valid &&
360
+ struct cached_fid * cfid = & tcon -> cfids -> cfid ;
361
+
362
+ if (cfid -> is_valid &&
359
363
!memcmp (lease_key ,
360
- tcon -> cfid -> fid .lease_key ,
364
+ cfid -> fid .lease_key ,
361
365
SMB2_LEASE_KEY_SIZE )) {
362
- tcon -> cfid -> time = 0 ;
363
- INIT_WORK (& tcon -> cfid -> lease_break ,
366
+ cfid -> time = 0 ;
367
+ INIT_WORK (& cfid -> lease_break ,
364
368
smb2_cached_lease_break );
365
369
queue_work (cifsiod_wq ,
366
- & tcon -> cfid -> lease_break );
370
+ & cfid -> lease_break );
367
371
return true;
368
372
}
369
373
return false;
370
374
}
371
375
372
- struct cached_fid * init_cached_dir (void )
376
+ struct cached_fids * init_cached_dirs (void )
373
377
{
374
- struct cached_fid * cfid ;
378
+ struct cached_fids * cfids ;
375
379
376
- cfid = kzalloc (sizeof (* cfid ), GFP_KERNEL );
377
- if (!cfid )
380
+ cfids = kzalloc (sizeof (* cfids ), GFP_KERNEL );
381
+ if (!cfids )
378
382
return NULL ;
379
- INIT_LIST_HEAD (& cfid -> dirents .entries );
380
- mutex_init (& cfid -> dirents .de_mutex );
381
- mutex_init (& cfid -> fid_mutex );
382
- return cfid ;
383
+ INIT_LIST_HEAD (& cfids -> cfid . dirents .entries );
384
+ mutex_init (& cfids -> cfid . dirents .de_mutex );
385
+ mutex_init (& cfids -> cfid . fid_mutex );
386
+ return cfids ;
383
387
}
384
388
385
- void free_cached_dir (struct cifs_tcon * tcon )
389
+ void free_cached_dirs (struct cached_fids * cfids )
386
390
{
387
- kfree (tcon -> cfid );
391
+ kfree (cfids );
388
392
}
0 commit comments