aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-15 15:34:03 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-17 21:32:01 -0400
commit4477288a103631980750c86547d1fd54bfd2ba7d (patch)
treee0d56476a740f043f6687e063ff88d2982b4c444 /fs/cifs/cifsfs.c
parent7a16f1961a5c61d1f60d9e0d3d171cf7793fb5cb (diff)
cifs: convert GlobalSMBSeslock from a rwlock to regular spinlock
Convert this lock to a regular spinlock A rwlock_t offers little value here. It's more expensive than a regular spinlock unless you have a fairly large section of code that runs under the read lock and can benefit from the concurrency. Additionally, we need to ensure that the refcounting for files isn't racy and to do that we need to lock areas that can increment it for write. That means that the areas that can actually use a read_lock are very few and relatively infrequently used. While we're at it, change the name to something easier to type, and fix a bug in find_writable_file. cifsFileInfo_put can sleep and shouldn't be called while holding the lock. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index cbd468c880c4..f1d9c71e807f 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -940,8 +940,8 @@ init_cifs(void)
940 GlobalTotalActiveXid = 0; 940 GlobalTotalActiveXid = 0;
941 GlobalMaxActiveXid = 0; 941 GlobalMaxActiveXid = 0;
942 memset(Local_System_Name, 0, 15); 942 memset(Local_System_Name, 0, 15);
943 rwlock_init(&GlobalSMBSeslock);
944 rwlock_init(&cifs_tcp_ses_lock); 943 rwlock_init(&cifs_tcp_ses_lock);
944 spin_lock_init(&cifs_file_list_lock);
945 spin_lock_init(&GlobalMid_Lock); 945 spin_lock_init(&GlobalMid_Lock);
946 946
947 if (cifs_max_pending < 2) { 947 if (cifs_max_pending < 2) {