diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-02-24 15:41:06 +0300 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2012-05-16 20:13:35 -0500 |
commit | fbd35acadd728eac5d94f360c7cd8cbe12a0379f (patch) | |
tree | 3db901833cee1e177aae17cb35e5d57fa998a27a /fs/cifs/cifsglob.h | |
parent | 121b046af54437b084aa0e4be967ae5aed7528b5 (diff) |
CIFS: Move locks to cifsFileInfo structure
CIFS brlock cache can be used by several file handles if we have a
write-caching lease on the file that is supported by SMB2 protocol.
Prepate the code to handle this situation correctly by sorting brlocks
by a fid to easily push them in portions when lease break comes.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
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 c41bf6d166e..03d24a5c977 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -568,7 +568,6 @@ struct cifsLockInfo { __u64 length; __u32 pid; __u8 type; - __u16 netfid; }; /* @@ -593,6 +592,10 @@ struct cifs_search_info { struct cifsFileInfo { struct list_head tlist; /* pointer to next fid owned by tcon */ struct list_head flist; /* next fid (file instance) for this inode */ + struct list_head llist; /* + * brlocks held by this fid, protected by + * lock_mutex from cifsInodeInfo structure + */ unsigned int uid; /* allows finding which FileInfo structure */ __u32 pid; /* process id who opened file */ __u16 netfid; /* file id from remote */ @@ -635,9 +638,12 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file); */ struct cifsInodeInfo { - struct list_head llist; /* brlocks for this inode */ bool can_cache_brlcks; - struct mutex lock_mutex; /* protect two fields above */ + struct mutex lock_mutex; /* + * protect the field above and llist + * from every cifsFileInfo structure + * from openFileList + */ /* BB add in lists for dirty pages i.e. write caching info for oplock */ struct list_head openFileList; __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ |