示例#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);
}
示例#2
0
文件: vvp_dev.c 项目: asmalldev/linux
int cl_sb_fini(struct super_block *sb)
{
	struct ll_sb_info *sbi;
	struct lu_env     *env;
	struct cl_device  *cld;
	u16 refcheck;
	int		result;

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

		if (cld) {
			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);
	}
	return result;
}
示例#3
0
文件: vvp_dev.c 项目: nemumu/linux
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;
}
示例#4
0
文件: lov_dev.c 项目: Chong-Li/cse522
static void lov_cl_del_target(const struct lu_env *env, struct lu_device *dev,
			      __u32 index)
{
	struct lov_device *ld = lu2lov_dev(dev);

	if (ld->ld_target[index] != NULL) {
		cl_stack_fini(env, lovsub2cl_dev(ld->ld_target[index]));
		ld->ld_target[index] = NULL;
	}
}
示例#5
0
文件: lov_dev.c 项目: Chong-Li/cse522
static struct lu_device *lov_device_fini(const struct lu_env *env,
					 struct lu_device *d)
{
	int i;
	struct lov_device *ld = lu2lov_dev(d);

	LASSERT(ld->ld_lov != NULL);
	if (ld->ld_target == NULL)
		return NULL;

	lov_foreach_target(ld, i) {
		struct lovsub_device *lsd;

		lsd = ld->ld_target[i];
		if (lsd != NULL) {
			cl_stack_fini(env, lovsub2cl_dev(lsd));
			ld->ld_target[i] = NULL;
		}
	}
	return NULL;
}