Skip to contentSkip to conversation

PATCH [2/10] lease interfaces for version 4 NFSD

PATCH William A.(Andy) Adamson 1 participant 1 message Sep 20, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

VFS: add a lock manager release private callback to locks_free_lock() for lock manager lease clean-up

fs/locks.c +5 -1
diff --recursive -puN old/fs/locks.c new/fs/locks.c
@@ -172,7 +172,11 @@ static inline void locks_free_lock(struc
 			fl->fl_ops->fl_release_private(fl);
 		fl->fl_ops = NULL;
 	}
-	fl->fl_lmops = NULL;
+	if (fl->fl_lmops) {
+		if (fl->fl_lmops->fl_release_private)
+			fl->fl_lmops->fl_release_private(fl);
+		fl->fl_lmops = NULL;
+	}
 
 	kmem_cache_free(filelock_cache, fl);
 }
include/linux/fs.h +1 -0
diff --recursive -puN old/include/linux/fs.h new/include/linux/fs.h
@@ -634,6 +634,7 @@ struct lock_manager_operations {
 	int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
 	void (*fl_notify)(struct file_lock *);	/* unblock callback */
 	void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
+	void (*fl_release_private)(struct file_lock *);
 };
 
 /* that will die - we need it for nfs_lock_info */