summaryrefslogtreecommitdiff
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-19 17:22:43 +0400
committerSteve French <smfrench@gmail.com>2012-09-25 06:46:32 +0400
commitf45d34167c67b083b54690e349e77f59062ef0ea (patch)
tree6be4f2a62e99e348e6cab03a24a1c45889a6722f /fs/cifs/cifsglob.h
parent1c0bd60b560cdf63a263f8ff3cebe9f99fe7a47c (diff)
downloadlinux-f45d34167c67b083b54690e349e77f59062ef0ea.tar.xz
CIFS: Remove spinlock dependence in brlock processing
Now we need to lock/unlock a spinlock while processing brlock ops on the inode. Move brlocks of a fid to a separate list and attach all such lists to the inode. This let us not hold a spinlock. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 004672f9e16c..b2eb577b5f3f 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -890,13 +890,16 @@ struct cifs_fid {
#endif
};
+struct cifs_fid_locks {
+ struct list_head llist;
+ struct cifsFileInfo *cfile; /* fid that owns locks */
+ struct list_head locks; /* locks held by fid above */
+};
+
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
- */
+ struct cifs_fid_locks *llist; /* brlocks held by this fid */
unsigned int uid; /* allows finding which FileInfo structure */
__u32 pid; /* process id who opened file */
struct cifs_fid fid; /* file id from remote */
@@ -988,11 +991,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file);
struct cifsInodeInfo {
bool can_cache_brlcks;
- struct mutex lock_mutex; /*
- * protect the field above and llist
- * from every cifsFileInfo structure
- * from openFileList
- */
+ struct list_head llist; /* locks helb by this inode */
+ struct mutex lock_mutex; /* protect the fields above */
/* 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 */