#include <linux/lustre_disk.h>
#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 */