From 6ea47b4b3da565d19db2e097ff6f91a78ebbabab Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 4 May 2006 12:27:26 +0000 Subject: [PATCH] - small improvements in llite_fid.c --- lustre/llite/llite_fid.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lustre/llite/llite_fid.c b/lustre/llite/llite_fid.c index 933d635..5b28077 100644 --- a/lustre/llite/llite_fid.c +++ b/lustre/llite/llite_fid.c @@ -35,36 +35,36 @@ #include #include "llite_internal.h" -/* allocates passed fid, that is assigns f_num and f_seq to the @fid */ -int ll_fid_md_alloc(struct ll_sb_info *sbi, struct lu_fid *fid, - struct placement_hint *hint) +static int ll_fid_alloc(struct obd_export *exp, struct lu_fid *fid, + struct placement_hint *hint) { int rc; ENTRY; - rc = obd_fid_alloc(sbi->ll_md_exp, fid, hint); + rc = obd_fid_alloc(exp, fid, hint); if (rc) { - CERROR("cannot allocate new metadata fid, rc %d\n", rc); + CERROR("cannot allocate new fid, rc %d\n", rc); RETURN(rc); } - + + LASSERT(fid_seq(fid) != 0 && fid_num(fid) != 0); RETURN(rc); } /* allocates passed fid, that is assigns f_num and f_seq to the @fid */ -int ll_fid_dt_alloc(struct ll_sb_info *sbi, struct lu_fid *fid, +int ll_fid_md_alloc(struct ll_sb_info *sbi, struct lu_fid *fid, struct placement_hint *hint) { - int rc; ENTRY; + RETURN(ll_fid_alloc(sbi->ll_md_exp, fid, hint)); +} - rc = obd_fid_alloc(sbi->ll_dt_exp, fid, hint); - if (rc) { - CERROR("cannot allocate new data fid, rc %d\n", rc); - RETURN(rc); - } - - RETURN(rc); +/* allocates passed fid, that is assigns f_num and f_seq to the @fid */ +int ll_fid_dt_alloc(struct ll_sb_info *sbi, struct lu_fid *fid, + struct placement_hint *hint) +{ + ENTRY; + RETURN(ll_fid_alloc(sbi->ll_dt_exp, fid, hint)); } /* build inode number on passed @fid */ -- 1.8.3.1