Lines Matching full:sdp
210 static int make_mode(struct gfs2_sbd *sdp, const unsigned int lmstate) in make_mode() argument
222 fs_err(sdp, "unknown LM state %d\n", lmstate); in make_mode()
329 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gdlm_put_lock() local
330 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_put_lock()
358 if (test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags) && in gdlm_put_lock()
373 fs_err(sdp, "gdlm_unlock %x,%llx err=%d\n", in gdlm_put_lock()
558 static int sync_unlock(struct gfs2_sbd *sdp, struct dlm_lksb *lksb, char *name) in sync_unlock() argument
560 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in sync_unlock()
565 fs_err(sdp, "%s lkid %x error %d\n", in sync_unlock()
573 fs_err(sdp, "%s lkid %x status %d\n", in sync_unlock()
580 static int sync_lock(struct gfs2_sbd *sdp, int mode, uint32_t flags, in sync_lock() argument
583 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in sync_lock()
594 fs_err(sdp, "%s lkid %x flags %x mode %d error %d\n", in sync_lock()
604 fs_err(sdp, "%s lkid %x flags %x mode %d status %d\n", in sync_lock()
611 static int mounted_unlock(struct gfs2_sbd *sdp) in mounted_unlock() argument
613 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in mounted_unlock()
614 return sync_unlock(sdp, &ls->ls_mounted_lksb, "mounted_lock"); in mounted_unlock()
617 static int mounted_lock(struct gfs2_sbd *sdp, int mode, uint32_t flags) in mounted_lock() argument
619 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in mounted_lock()
620 return sync_lock(sdp, mode, flags, GFS2_MOUNTED_LOCK, in mounted_lock()
624 static int control_unlock(struct gfs2_sbd *sdp) in control_unlock() argument
626 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in control_unlock()
627 return sync_unlock(sdp, &ls->ls_control_lksb, "control_lock"); in control_unlock()
630 static int control_lock(struct gfs2_sbd *sdp, int mode, uint32_t flags) in control_lock() argument
632 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in control_lock()
633 return sync_lock(sdp, mode, flags, GFS2_CONTROL_LOCK, in control_lock()
639 * @sdp: The superblock
641 static void remote_withdraw(struct gfs2_sbd *sdp) in remote_withdraw() argument
646 list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) { in remote_withdraw()
647 if (jd->jd_jid == sdp->sd_lockstruct.ls_jid) in remote_withdraw()
656 fs_err(sdp, "Journals checked: %d, ret = %d.\n", count, ret); in remote_withdraw()
661 struct gfs2_sbd *sdp = container_of(work, struct gfs2_sbd, sd_control_work.work); in gfs2_control_func() local
662 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gfs2_control_func()
670 if (test_bit(SDF_REMOTE_WITHDRAW, &sdp->sd_flags)) { in gfs2_control_func()
671 remote_withdraw(sdp); in gfs2_control_func()
672 clear_bit(SDF_REMOTE_WITHDRAW, &sdp->sd_flags); in gfs2_control_func()
717 error = control_lock(sdp, DLM_LOCK_EX, DLM_LKF_CONVERT|DLM_LKF_VALBLK); in gfs2_control_func()
719 fs_err(sdp, "control lock EX error %d\n", error); in gfs2_control_func()
728 fs_info(sdp, "recover generation %u block1 %u %u\n", in gfs2_control_func()
731 control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT); in gfs2_control_func()
800 error = control_lock(sdp, DLM_LOCK_NL, flags); in gfs2_control_func()
802 fs_err(sdp, "control lock NL error %d\n", error); in gfs2_control_func()
815 fs_info(sdp, "recover generation %u jid %d\n", in gfs2_control_func()
817 gfs2_recover_set(sdp, i); in gfs2_control_func()
835 fs_info(sdp, "recover generation %u done\n", start_gen); in gfs2_control_func()
836 gfs2_glock_thaw(sdp); in gfs2_control_func()
838 fs_info(sdp, "recover generation %u block2 %u %u\n", in gfs2_control_func()
844 static int control_mount(struct gfs2_sbd *sdp) in control_mount() argument
846 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in control_mount()
860 error = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_VALBLK); in control_mount()
862 fs_err(sdp, "control_mount control_lock NL error %d\n", error); in control_mount()
866 error = mounted_lock(sdp, DLM_LOCK_NL, 0); in control_mount()
868 fs_err(sdp, "control_mount mounted_lock NL error %d\n", error); in control_mount()
869 control_unlock(sdp); in control_mount()
886 error = mounted_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT); in control_mount()
906 error = control_lock(sdp, DLM_LOCK_EX, DLM_LKF_CONVERT|DLM_LKF_NOQUEUE|DLM_LKF_VALBLK); in control_mount()
910 fs_err(sdp, "control_mount control_lock EX error %d\n", error); in control_mount()
918 if (sdp->sd_args.ar_spectator) in control_mount()
921 error = mounted_lock(sdp, DLM_LOCK_EX, DLM_LKF_CONVERT|DLM_LKF_NOQUEUE); in control_mount()
926 fs_err(sdp, "control_mount mounted_lock EX error %d\n", error); in control_mount()
930 error = mounted_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERT|DLM_LKF_NOQUEUE); in control_mount()
936 fs_err(sdp, "control_mount mounted_lock PR error %d\n", error); in control_mount()
956 fs_err(sdp, "control_mount control_lock disabled\n"); in control_mount()
968 fs_info(sdp, "first mounter control generation %u\n", lvb_gen); in control_mount()
972 error = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT); in control_mount()
984 fs_info(sdp, "control_mount wait for journal recovery\n"); in control_mount()
996 if (sdp->sd_args.ar_spectator) { in control_mount()
997 fs_info(sdp, "Recovery is required. Waiting for a " in control_mount()
1001 fs_info(sdp, "control_mount wait1 block %u start %u " in control_mount()
1013 fs_info(sdp, "control_mount wait2 block %u start %u mount %u " in control_mount()
1022 fs_info(sdp, "control_mount wait3 block %u start %u mount %u " in control_mount()
1037 mounted_unlock(sdp); in control_mount()
1038 control_unlock(sdp); in control_mount()
1042 static int control_first_done(struct gfs2_sbd *sdp) in control_first_done() argument
1044 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in control_first_done()
1057 fs_err(sdp, "control_first_done start %u block %u flags %lx\n", in control_first_done()
1060 control_unlock(sdp); in control_first_done()
1073 fs_info(sdp, "control_first_done wait gen %u\n", start_gen); in control_first_done()
1089 error = mounted_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERT); in control_first_done()
1091 fs_err(sdp, "control_first_done mounted PR error %d\n", error); in control_first_done()
1093 error = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT|DLM_LKF_VALBLK); in control_first_done()
1095 fs_err(sdp, "control_first_done control NL error %d\n", error); in control_first_done()
1108 static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots, in set_recover_size() argument
1111 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in set_recover_size()
1171 struct gfs2_sbd *sdp = arg; in gdlm_recover_prep() local
1172 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_recover_prep()
1174 if (gfs2_withdrawing_or_withdrawn(sdp)) { in gdlm_recover_prep()
1175 fs_err(sdp, "recover_prep ignored due to withdraw.\n"); in gdlm_recover_prep()
1196 struct gfs2_sbd *sdp = arg; in gdlm_recover_slot() local
1197 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_recover_slot()
1200 if (gfs2_withdrawing_or_withdrawn(sdp)) { in gdlm_recover_slot()
1201 fs_err(sdp, "recover_slot jid %d ignored due to withdraw.\n", in gdlm_recover_slot()
1207 fs_err(sdp, "recover_slot jid %d gen %u short size %d\n", in gdlm_recover_slot()
1214 fs_info(sdp, "recover_slot jid %d gen %u prev %u\n", in gdlm_recover_slot()
1226 struct gfs2_sbd *sdp = arg; in gdlm_recover_done() local
1227 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_recover_done()
1229 if (gfs2_withdrawing_or_withdrawn(sdp)) { in gdlm_recover_done()
1230 fs_err(sdp, "recover_done ignored due to withdraw.\n"); in gdlm_recover_done()
1234 set_recover_size(sdp, slots, num_slots); in gdlm_recover_done()
1245 queue_delayed_work(gfs2_control_wq, &sdp->sd_control_work, 0); in gdlm_recover_done()
1255 static void gdlm_recovery_result(struct gfs2_sbd *sdp, unsigned int jid, in gdlm_recovery_result() argument
1258 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_recovery_result()
1260 if (gfs2_withdrawing_or_withdrawn(sdp)) { in gdlm_recovery_result()
1261 fs_err(sdp, "recovery_result jid %d ignored due to withdraw.\n", in gdlm_recovery_result()
1278 fs_err(sdp, "recovery_result jid %d short size %d\n", in gdlm_recovery_result()
1284 fs_info(sdp, "recover jid %d result %s\n", jid, in gdlm_recovery_result()
1294 queue_delayed_work(gfs2_control_wq, &sdp->sd_control_work, in gdlm_recovery_result()
1305 static int gdlm_mount(struct gfs2_sbd *sdp, const char *table) in gdlm_mount() argument
1307 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_mount()
1317 INIT_DELAYED_WORK(&sdp->sd_control_work, gfs2_control_func); in gdlm_mount()
1328 error = set_recover_size(sdp, NULL, 0); in gdlm_mount()
1338 fs_info(sdp, "no fsname found\n"); in gdlm_mount()
1353 &gdlm_lockspace_ops, sdp, &ops_result, in gdlm_mount()
1356 fs_err(sdp, "dlm_new_lockspace error %d\n", error); in gdlm_mount()
1365 fs_info(sdp, "dlm lockspace ops not used\n"); in gdlm_mount()
1371 if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) { in gdlm_mount()
1372 fs_err(sdp, "dlm lockspace ops disallow jid preset\n"); in gdlm_mount()
1382 error = control_mount(sdp); in gdlm_mount()
1384 fs_err(sdp, "mount control error %d\n", error); in gdlm_mount()
1389 clear_bit(SDF_NOJOURNALID, &sdp->sd_flags); in gdlm_mount()
1391 wake_up_bit(&sdp->sd_flags, SDF_NOJOURNALID); in gdlm_mount()
1402 static void gdlm_first_done(struct gfs2_sbd *sdp) in gdlm_first_done() argument
1404 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_first_done()
1410 error = control_first_done(sdp); in gdlm_first_done()
1412 fs_err(sdp, "mount first_done error %d\n", error); in gdlm_first_done()
1415 static void gdlm_unmount(struct gfs2_sbd *sdp) in gdlm_unmount() argument
1417 struct lm_lockstruct *ls = &sdp->sd_lockstruct; in gdlm_unmount()
1427 flush_delayed_work(&sdp->sd_control_work); in gdlm_unmount()