From b4cfc9fff1c8bebbe6ab03d61e0d95366680e800 Mon Sep 17 00:00:00 2001 From: fanyong Date: Sat, 7 Oct 2006 09:14:15 +0000 Subject: [PATCH] (1) drop unnecessary ops. (2) small fix for remote_perm. --- lustre/mdt/mdt_handler.c | 11 ++--------- lustre/mdt/mdt_lib.c | 2 -- lustre/mdt/mdt_open.c | 3 +-- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 94f8790..ec78cc9 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -959,10 +959,6 @@ static int mdt_readpage(struct mdt_thread_info *info) if (reqbody == NULL || repbody == NULL) RETURN(err_serious(-EFAULT)); - rc = mdt_init_ucred(info, reqbody); - if (rc) - RETURN(rc); - /* * prepare @rdpg before calling lower layers and transfer itself. Here * reqbody->size contains offset of where to start to read and @@ -972,13 +968,13 @@ static int mdt_readpage(struct mdt_thread_info *info) if ((__u64)rdpg->rp_hash != reqbody->size) { CERROR("Invalid hash: %#llx != %#llx\n", (__u64)rdpg->rp_hash, reqbody->size); - GOTO(out, rc = -EFAULT); + RETURN(-EFAULT); } rdpg->rp_count = reqbody->nlink; rdpg->rp_npages = (rdpg->rp_count + CFS_PAGE_SIZE - 1)>>CFS_PAGE_SHIFT; OBD_ALLOC(rdpg->rp_pages, rdpg->rp_npages * sizeof rdpg->rp_pages[0]); if (rdpg->rp_pages == NULL) - GOTO(out, rc = -ENOMEM); + RETURN(-ENOMEM); for (i = 0; i < rdpg->rp_npages; ++i) { rdpg->rp_pages[i] = alloc_pages(GFP_KERNEL, 0); @@ -1006,11 +1002,8 @@ free_rdpg: __free_pages(rdpg->rp_pages[i], 0); OBD_FREE(rdpg->rp_pages, rdpg->rp_npages * sizeof rdpg->rp_pages[0]); - mdt_exit_ucred(info); MDT_FAIL_RETURN(OBD_FAIL_MDS_SENDPAGE, 0); -out: - mdt_exit_ucred(info); return rc ? rc : rc1; } diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index f36ca46..233dac5 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -615,8 +615,6 @@ static int mdt_setattr_unpack_rec(struct mdt_thread_info *info) uc->mu_fsuid = rec->sa_fsuid; uc->mu_fsgid = rec->sa_fsgid; - uc->mu_uid = rec->sa_uid; - uc->mu_gid = rec->sa_gid; uc->mu_cap = rec->sa_cap; uc->mu_suppgids[0] = rec->sa_suppgid; uc->mu_suppgids[1] = -1; diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 6e7d31c..51c48c2 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -316,7 +316,6 @@ static int mdt_mfd_open(struct mdt_thread_info *info, struct md_attr *ma = &info->mti_attr; struct lu_attr *la = &ma->ma_attr; struct mdt_file_data *mfd; - const struct mdt_body *reqbody = info->mti_body; struct mdt_body *repbody; int rc = 0; int isreg, isdir, islnk; @@ -333,7 +332,7 @@ static int mdt_mfd_open(struct mdt_thread_info *info, mdt_pack_attr2body(repbody, la, mdt_object_fid(o)); mdt_body_reverse_idmap(info, repbody); - if (med->med_rmtclient && (reqbody->valid & OBD_MD_FLRMTPERM)) { + if (med->med_rmtclient) { void *buf = req_capsule_server_get(&info->mti_pill, &RMF_ACL); rc = mdt_pack_remote_perm(info, o, buf); -- 1.8.3.1