aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton <jeff.layton@primarydata.com>2015-02-16 14:32:03 -0500
committerJeff Layton <jeff.layton@primarydata.com>2015-02-16 14:32:03 -0500
commite084c1bd40926938ff8d26af3bde34396dd4d06d (patch)
tree5d4dd8e3eaf5c46430670d4858084230128f3bbd /fs/ceph
parent1fa185ebcbcefdc5229c783450c9f0439a69f0c1 (diff)
Revert "locks: keep a count of locks on the flctx lists"
This reverts commit 9bd0f45b7037fcfa8b575c7e27d0431d6e6dc3bb. Linus rightly pointed out that I failed to initialize the counters when adding them, so they don't work as expected. Just revert this patch for now. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/locks.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index 06ea5cd05cd9..4347039ecc18 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -245,6 +245,7 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
245 */ 245 */
246void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count) 246void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
247{ 247{
248 struct file_lock *lock;
248 struct file_lock_context *ctx; 249 struct file_lock_context *ctx;
249 250
250 *fcntl_count = 0; 251 *fcntl_count = 0;
@@ -252,8 +253,12 @@ void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count)
252 253
253 ctx = inode->i_flctx; 254 ctx = inode->i_flctx;
254 if (ctx) { 255 if (ctx) {
255 *fcntl_count = ctx->flc_posix_cnt; 256 spin_lock(&ctx->flc_lock);
256 *flock_count = ctx->flc_flock_cnt; 257 list_for_each_entry(lock, &ctx->flc_posix, fl_list)
258 ++(*fcntl_count);
259 list_for_each_entry(lock, &ctx->flc_flock, fl_list)
260 ++(*flock_count);
261 spin_unlock(&ctx->flc_lock);
257 } 262 }
258 dout("counted %d flock locks and %d fcntl locks", 263 dout("counted %d flock locks and %d fcntl locks",
259 *flock_count, *fcntl_count); 264 *flock_count, *fcntl_count);