From e7dd784859afa97e9690d8d2e18f21314ebf6ac9 Mon Sep 17 00:00:00 2001 From: rread Date: Fri, 23 Aug 2002 01:41:16 +0000 Subject: [PATCH] - add lov_pack.c to llite - clean up ll_create_node for non-intent usage --- lustre/llite/Makefile.am | 4 ++++ lustre/llite/namei.c | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lustre/llite/Makefile.am b/lustre/llite/Makefile.am index b5d50b5..dbdb16a 100644 --- a/lustre/llite/Makefile.am +++ b/lustre/llite/Makefile.am @@ -16,8 +16,12 @@ page.c: LINX=page.c llite_SOURCES = dcache.c recover.c commit_callback.c super.c rw.c llite_SOURCES += file.c dir.c sysctl.c namei.c symlink.c $(LINX) +llite_SOURCES += lov_pack.c dist-hook: list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done +lov_pack.c: + test -e lov_pack.c || ln -sf $(top_srcdir)/lib/lov_pack.c . + include $(top_srcdir)/Rules diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index e8542b0..9819c83 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -36,6 +36,8 @@ #include #include #include +#include + extern struct address_space_operations ll_aops; /* from super.c */ @@ -281,6 +283,8 @@ static struct inode *ll_create_node(struct inode *dir, const char *name, struct ll_sb_info *sbi = ll_i2sbi(dir); int gid = current->fsgid; struct ll_inode_md md; + struct lov_mds_md *mds_md = NULL; + int mds_md_size = 0; ENTRY; @@ -299,7 +303,14 @@ static struct inode *ll_create_node(struct inode *dir, const char *name, GOTO(out, rc); } body = lustre_msg_buf(request->rq_repmsg, 0); - md.md = smd; + if (smd != NULL) { + mds_md_size = sizeof (struct lov_mds_md) + + smd->lmd_stripe_count * sizeof(struct lov_object_id); + OBD_ALLOC(mds_md, mds_md_size); + lov_packmd(mds_md, smd); + } else + md.md = NULL; + } else { request = it->it_data; body = lustre_msg_buf(request->rq_repmsg, 1); @@ -336,6 +347,8 @@ static struct inode *ll_create_node(struct inode *dir, const char *name, EXIT; out: + if (mds_md != NULL) + OBD_FREE(mds_md, mds_md_size); ptlrpc_free_req(request); return inode; } -- 1.8.3.1