diff options
author | Sage Weil <sage@newdream.net> | 2010-09-22 22:57:10 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-10-20 18:38:18 -0400 |
commit | 496e59553c51ce18acc836de070106b583926b87 (patch) | |
tree | a171b2ec236fd021d4f17ea9d5df7312e93c1645 /fs/ceph | |
parent | fca4451acfdcf894154e4809529ca28a09db88ff (diff) |
ceph: switch from BKL to lock_flocks()
Switch from using the BKL explicitly to the new lock_flocks() interface.
Eventually this will turn into a spinlock.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/mds_client.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index fbfc298ac55b..3142b15940c2 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -1,11 +1,12 @@ | |||
1 | #include <linux/ceph/ceph_debug.h> | 1 | #include <linux/ceph/ceph_debug.h> |
2 | 2 | ||
3 | #include <linux/fs.h> | ||
3 | #include <linux/wait.h> | 4 | #include <linux/wait.h> |
4 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <linux/smp_lock.h> | ||
7 | #include <linux/debugfs.h> | 7 | #include <linux/debugfs.h> |
8 | #include <linux/seq_file.h> | 8 | #include <linux/seq_file.h> |
9 | #include <linux/smp_lock.h> | ||
9 | 10 | ||
10 | #include "super.h" | 11 | #include "super.h" |
11 | #include "mds_client.h" | 12 | #include "mds_client.h" |
@@ -2369,13 +2370,13 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
2369 | 2370 | ||
2370 | ceph_pagelist_set_cursor(pagelist, &trunc_point); | 2371 | ceph_pagelist_set_cursor(pagelist, &trunc_point); |
2371 | do { | 2372 | do { |
2372 | lock_kernel(); | 2373 | lock_flocks(); |
2373 | ceph_count_locks(inode, &num_fcntl_locks, | 2374 | ceph_count_locks(inode, &num_fcntl_locks, |
2374 | &num_flock_locks); | 2375 | &num_flock_locks); |
2375 | rec.v2.flock_len = (2*sizeof(u32) + | 2376 | rec.v2.flock_len = (2*sizeof(u32) + |
2376 | (num_fcntl_locks+num_flock_locks) * | 2377 | (num_fcntl_locks+num_flock_locks) * |
2377 | sizeof(struct ceph_filelock)); | 2378 | sizeof(struct ceph_filelock)); |
2378 | unlock_kernel(); | 2379 | unlock_flocks(); |
2379 | 2380 | ||
2380 | /* pre-alloc pagelist */ | 2381 | /* pre-alloc pagelist */ |
2381 | ceph_pagelist_truncate(pagelist, &trunc_point); | 2382 | ceph_pagelist_truncate(pagelist, &trunc_point); |
@@ -2386,12 +2387,12 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
2386 | 2387 | ||
2387 | /* encode locks */ | 2388 | /* encode locks */ |
2388 | if (!err) { | 2389 | if (!err) { |
2389 | lock_kernel(); | 2390 | lock_flocks(); |
2390 | err = ceph_encode_locks(inode, | 2391 | err = ceph_encode_locks(inode, |
2391 | pagelist, | 2392 | pagelist, |
2392 | num_fcntl_locks, | 2393 | num_fcntl_locks, |
2393 | num_flock_locks); | 2394 | num_flock_locks); |
2394 | unlock_kernel(); | 2395 | unlock_flocks(); |
2395 | } | 2396 | } |
2396 | } while (err == -ENOSPC); | 2397 | } while (err == -ENOSPC); |
2397 | } else { | 2398 | } else { |