diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2018-06-14 06:48:35 +1000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-06-15 02:38:07 -0500 |
commit | a93864d93977b99bda6c348a09b90a3d7ef8db3a (patch) | |
tree | 30d488812c67cb68adce979d2b642756e9281a37 /fs/cifs/cifsglob.h | |
parent | 2fbb56446fde14a80790de9b182ae6f7c36a039a (diff) | |
download | linux-a93864d93977b99bda6c348a09b90a3d7ef8db3a.tar.gz linux-a93864d93977b99bda6c348a09b90a3d7ef8db3a.tar.bz2 linux-a93864d93977b99bda6c348a09b90a3d7ef8db3a.zip |
cifs: add lease tracking to the cached root fid
Use a read lease for the cached root fid so that we can detect
when the content of the directory changes (via a break) at which time
we close the handle. On next access to the root the handle will be reopened
and cached again.
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 1efa2e65bc1a..ff71fbd619bf 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -883,6 +883,14 @@ cap_unix(struct cifs_ses *ses) return ses->server->vals->cap_unix & ses->capabilities; } +struct cached_fid { + bool is_valid:1; /* Do we have a useable root fid */ + struct cifs_fid *fid; + struct mutex fid_mutex; + struct cifs_tcon *tcon; + struct work_struct lease_break; +}; + /* * there is one of these for each connection to a resource on a particular * session @@ -987,9 +995,7 @@ struct cifs_tcon { struct fscache_cookie *fscache; /* cookie for share */ #endif struct list_head pending_opens; /* list of incomplete opens */ - bool valid_root_fid:1; /* Do we have a useable root fid */ - struct mutex prfid_mutex; /* prevents reopen race after dead ses*/ - struct cifs_fid *prfid; /* handle to the directory at top of share */ + struct cached_fid crfid; /* Cached root fid */ /* BB add field for back pointer to sb struct(s)? */ }; |