/* The lsi has one reference for every server that is using the disk - * e.g. MDT, MGS, and potentially MGC */ static int lustre_put_lsi(struct super_block *sb) { struct lustre_sb_info *lsi = s2lsi(sb); CDEBUG(D_MOUNT, "put %p %d\n", sb, atomic_read(&lsi->lsi_mounts)); if (atomic_dec_and_test(&lsi->lsi_mounts)) { lustre_free_lsi(sb); return 1; } return 0; }
/* The lsi has one reference for every server that is using the disk - e.g. MDT, MGS, and potentially MGC */ int lustre_put_lsi(struct super_block *sb) { struct lustre_sb_info *lsi = s2lsi(sb); LASSERT(lsi != NULL); CDEBUG(D_MOUNT, "put %p %d\n", sb, atomic_read(&lsi->lsi_mounts)); if (atomic_dec_and_test(&lsi->lsi_mounts)) { if (IS_SERVER(lsi) && lsi->lsi_osd_exp) { lu_device_put(&lsi->lsi_dt_dev->dd_lu_dev); lsi->lsi_osd_exp->exp_obd->obd_lvfs_ctxt.dt = NULL; lsi->lsi_dt_dev = NULL; obd_disconnect(lsi->lsi_osd_exp); /* wait till OSD is gone */ obd_zombie_barrier(); } lustre_free_lsi(sb); return 1; } return 0; }