Esempio n. 1
0
int cl_sb_fini(struct llu_sb_info *sbi)
{
        struct lu_env *env;
        int refcheck;

        ENTRY;

        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
                RETURN(PTR_ERR(env));

        if (sbi->ll_cl != NULL) {
                cl_stack_fini(env, sbi->ll_cl);
                sbi->ll_cl = NULL;
                sbi->ll_site = NULL;
        }
        cl_env_put(env, &refcheck);
        /*
         * If mount failed (sbi->ll_cl == NULL), and this there are no other
         * mounts, stop device types manually (this usually happens
         * automatically when last device is destroyed).
         */
        lu_types_stop();
        cl_env_cache_purge(~0);
        RETURN(0);
}
Esempio n. 2
0
int cl_sb_fini(struct super_block *sb)
{
    struct ll_sb_info *sbi;
    struct lu_env     *env;
    struct cl_device  *cld;
    int		refcheck;
    int		result;

    sbi = ll_s2sbi(sb);
    env = cl_env_get(&refcheck);
    if (!IS_ERR(env)) {
        cld = sbi->ll_cl;

        if (cld != NULL) {
            cl_stack_fini(env, cld);
            sbi->ll_cl = NULL;
            sbi->ll_site = NULL;
        }
        cl_env_put(env, &refcheck);
        result = 0;
    } else {
        CERROR("Cannot cleanup cl-stack due to memory shortage.\n");
        result = PTR_ERR(env);
    }
    /*
     * If mount failed (sbi->ll_cl == NULL), and this there are no other
     * mounts, stop device types manually (this usually happens
     * automatically when last device is destroyed).
     */
    lu_types_stop();
    return result;
}
Esempio n. 3
0
/* Common umount */
int lustre_common_put_super(struct super_block *sb)
{
	int rc;

	CDEBUG(D_MOUNT, "dropping sb %p\n", sb);

	/* Drop a ref to the MGC */
	rc = lustre_stop_mgc(sb);
	if (rc && (rc != -ENOENT)) {
		if (rc != -EBUSY) {
			CERROR("Can't stop MGC: %d\n", rc);
			return rc;
		}
		/* BUSY just means that there's some other obd that
		   needs the mgc.  Let him clean it up. */
		CDEBUG(D_MOUNT, "MGC still in use\n");
	}
	/* Drop a ref to the mounted disk */
	lustre_put_lsi(sb);
	lu_types_stop();
	return rc;
}