Esempio n. 1
0
File: mdt_lib.c Progetto: hpc/lustre
static int mdt_setattr_unpack(struct mdt_thread_info *info)
{
        struct md_attr          *ma = &info->mti_attr;
        struct req_capsule      *pill = info->mti_pill;
        int rc;
        ENTRY;

        rc = mdt_setattr_unpack_rec(info);
        if (rc)
                RETURN(rc);

        /* Epoch may be absent */
        mdt_ioepoch_unpack(info);

        ma->ma_lmm_size = req_capsule_get_size(pill, &RMF_EADATA, RCL_CLIENT);
        if (ma->ma_lmm_size) {
                ma->ma_lmm = req_capsule_client_get(pill, &RMF_EADATA);
                ma->ma_valid |= MA_LOV;
        }

        ma->ma_cookie_size = req_capsule_get_size(pill, &RMF_LOGCOOKIES,
                                                  RCL_CLIENT);
        if (ma->ma_cookie_size) {
                ma->ma_cookie = req_capsule_client_get(pill, &RMF_LOGCOOKIES);
                ma->ma_valid |= MA_COOKIE;
        }

        rc = mdt_dlmreq_unpack(info);
        RETURN(rc);
}
Esempio n. 2
0
static int mdt_setattr_unpack(struct mdt_thread_info *info)
{
        struct mdt_reint_record *rr = &info->mti_rr;
        struct md_attr          *ma = &info->mti_attr;
        struct req_capsule      *pill = info->mti_pill;
        int rc;
        ENTRY;

        rc = mdt_setattr_unpack_rec(info);
        if (rc)
                RETURN(rc);

        /* Epoch may be absent */
        mdt_ioepoch_unpack(info);

        if (req_capsule_field_present(pill, &RMF_EADATA, RCL_CLIENT)) {
                rr->rr_eadata = req_capsule_client_get(pill, &RMF_EADATA);
                rr->rr_eadatalen = req_capsule_get_size(pill, &RMF_EADATA,
                                                        RCL_CLIENT);
                ma->ma_lmm_size = rr->rr_eadatalen;
                if (ma->ma_lmm_size > 0) {
                        ma->ma_lmm = (void *)rr->rr_eadata;
                        ma->ma_valid |= MA_LOV;
                }
        }

        rc = mdt_dlmreq_unpack(info);
        RETURN(rc);
}
Esempio n. 3
0
File: mdt_lib.c Progetto: hpc/lustre
int mdt_close_unpack(struct mdt_thread_info *info)
{
        int rc;
        ENTRY;

        rc = mdt_ioepoch_unpack(info);
        if (rc)
                RETURN(rc);

        RETURN(mdt_setattr_unpack_rec(info));
}
Esempio n. 4
0
static int mdt_setattr_unpack(struct mdt_thread_info *info)
{
        struct mdt_reint_record *rr = &info->mti_rr;
        struct md_attr          *ma = &info->mti_attr;
        struct req_capsule      *pill = info->mti_pill;
        int rc;
        ENTRY;

        rc = mdt_setattr_unpack_rec(info);
        if (rc)
                RETURN(rc);

        /* Epoch may be absent */
        mdt_ioepoch_unpack(info);

        if (req_capsule_field_present(pill, &RMF_EADATA, RCL_CLIENT)) {
                rr->rr_eadata = req_capsule_client_get(pill, &RMF_EADATA);
                rr->rr_eadatalen = req_capsule_get_size(pill, &RMF_EADATA,
                                                        RCL_CLIENT);
		if (rr->rr_eadatalen > 0) {
			const struct lmv_user_md	*lum;

			lum = rr->rr_eadata;
			/* Sigh ma_valid(from req) does not indicate whether
			 * it will set LOV/LMV EA, so we have to check magic */
			if (le32_to_cpu(lum->lum_magic) == LMV_USER_MAGIC) {
				ma->ma_valid |= MA_LMV;
				ma->ma_lmv = (void *)rr->rr_eadata;
				ma->ma_lmv_size = rr->rr_eadatalen;
			} else {
				ma->ma_valid |= MA_LOV;
				ma->ma_lmm = (void *)rr->rr_eadata;
				ma->ma_lmm_size = rr->rr_eadatalen;
			}
		}
	}

	rc = mdt_dlmreq_unpack(info);
	RETURN(rc);
}