summaryrefslogtreecommitdiff
path: root/fs/locks.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-08-22 10:18:43 -0400
committerJeff Layton <jlayton@primarydata.com>2014-09-09 16:01:09 -0400
commit5c97d7b1479982a48cf2129062b880c2555049ac (patch)
treea0e740e0e35d0ccda973e4c13b84a89605fef176 /fs/locks.c
parent3fe0fff18fe87c6a2179837de68d1174903c6367 (diff)
downloadlwn-5c97d7b1479982a48cf2129062b880c2555049ac.tar.gz
lwn-5c97d7b1479982a48cf2129062b880c2555049ac.zip
locks: New ops in lock_manager_operations for get/put owner
NFSD or other lockmanager may increase the owner's reference, so adds two new options for copying and releasing owner. v5: change order from 2/6 to 3/6 v4: rename lm_copy_owner/lm_release_owner to lm_get_owner/lm_put_owner Reviewed-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c
index ec9becd02d3d..5e83f3a99377 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -230,8 +230,12 @@ void locks_release_private(struct file_lock *fl)
fl->fl_ops->fl_release_private(fl);
fl->fl_ops = NULL;
}
- fl->fl_lmops = NULL;
+ if (fl->fl_lmops) {
+ if (fl->fl_lmops->lm_put_owner)
+ fl->fl_lmops->lm_put_owner(fl);
+ fl->fl_lmops = NULL;
+ }
}
EXPORT_SYMBOL_GPL(locks_release_private);
@@ -274,8 +278,12 @@ static void locks_copy_private(struct file_lock *new, struct file_lock *fl)
fl->fl_ops->fl_copy_lock(new, fl);
new->fl_ops = fl->fl_ops;
}
- if (fl->fl_lmops)
+
+ if (fl->fl_lmops) {
+ if (fl->fl_lmops->lm_get_owner)
+ fl->fl_lmops->lm_get_owner(new, fl);
new->fl_lmops = fl->fl_lmops;
+ }
}
/*