}
+/*
+ * drop all leases (and dentry refs) in preparation for umount
+ */
+void ceph_mdsc_drop_leases(struct ceph_mds_client *mdsc)
+{
+ int i;
+
+ spin_lock(&mdsc->lock);
+ for (i = 0; i < mdsc->max_sessions; i++) {
+ struct ceph_mds_session *session = __get_session(mdsc, i);
+ if (!session)
+ continue;
+ spin_unlock(&mdsc->lock);
+ remove_session_leases(session);
+ spin_lock(&mdsc->lock);
+ }
+ spin_unlock(&mdsc->lock);
+}
/* exported functions */
struct ceph_mds_session *session,
struct ceph_inode_cap *cap,
int used, int wanted, int cancel_work);
+extern void ceph_mdsc_drop_leases(struct ceph_mds_client *mdsc);
#endif
{
struct ceph_client *client = ceph_sb_to_client(s);
dout(1, "kill_sb %p\n", s);
+ ceph_mdsc_drop_leases(&client->mdsc);
kill_anon_super(s); /* will call put_super after sb is r/o */
ceph_destroy_client(client);
}