Merge branch 'audit.b32' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[pandora-kernel.git] / fs / lockd / svcshare.c
index 27288c8..b9926ce 100644 (file)
@@ -85,24 +85,20 @@ nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file,
 }
 
 /*
- * Traverse all shares for a given file (and host).
- * NLM_ACT_CHECK is handled by nlmsvc_inspect_file.
+ * Traverse all shares for a given file, and delete
+ * those owned by the given (type of) host
  */
-void
-nlmsvc_traverse_shares(struct nlm_host *host, struct nlm_file *file, int action)
+void nlmsvc_traverse_shares(struct nlm_host *host, struct nlm_file *file,
+               nlm_host_match_fn_t match)
 {
        struct nlm_share        *share, **shpp;
 
        shpp = &file->f_shares;
        while ((share = *shpp) !=  NULL) {
-               if (action == NLM_ACT_MARK)
-                       share->s_host->h_inuse = 1;
-               else if (action == NLM_ACT_UNLOCK) {
-                       if (host == NULL || host == share->s_host) {
-                               *shpp = share->s_next;
-                               kfree(share);
-                               continue;
-                       }
+               if (match(share->s_host, host)) {
+                       *shpp = share->s_next;
+                       kfree(share);
+                       continue;
                }
                shpp = &share->s_next;
        }