* request to the right MDS */
mds = raw_name2idx(obj->objcount, (char *)name, len);
CDEBUG(D_OTHER, "forward to MDS #%u\n", mds);
-
rpfid = obj->objs[mds].fid;
lmv_put_obj(obj);
}
* because returned values will be put in struct inode */
obj = lmv_grab_obj(obd, pfid);
- if (obj && len) {
- /* directory is already splitted. calculate mds */
- mds = raw_name2idx(obj->objcount, (char *)name, len);
- rpfid = obj->objs[mds].fid;
+ if (obj) {
+ if (len) {
+ /* directory is already splitted. calculate mds */
+ mds = raw_name2idx(obj->objcount, (char *)name, len);
+ rpfid = obj->objs[mds].fid;
+ }
lmv_put_obj(obj);
}
CWARN("lookup for %lu/%lu/%lu and data should be uptodate\n",
(unsigned long)rpfid.mds, (unsigned long)rpfid.id,
(unsigned long)rpfid.generation);
-
LASSERT(*reqp == NULL);
RETURN(rc);
}
obj = lmv_create_obj(exp, &rpfid, NULL);
if (IS_ERR(obj))
RETURN(PTR_ERR(obj));
-
+ lmv_put_obj(obj);
goto repeat;
}
obj = lmv_create_obj(exp, &body->fid1, mea);
if (IS_ERR(obj))
RETURN(PTR_ERR(obj));
- } else {
- lmv_put_obj(obj);
}
+ lmv_put_obj(obj);
}
RETURN(rc);
if (obj) {
obj->state |= O_FREEING;
+ if (atomic_read(&obj->count) > 1)
+ CERROR("obj %lu/%lu/%lu has count > 2 (%d)\n",
+ (unsigned long) obj->fid.mds,
+ (unsigned long) obj->fid.id,
+ (unsigned long) obj->fid.generation,
+ atomic_read(&obj->count));
__put_obj(obj);
__put_obj(obj);
rc = 1;
int
lmv_setup_mgr(struct obd_device *obd)
{
- CWARN("LMV object manager setup (%s)\n",
- obd->obd_uuid.uuid);
+ CDEBUG(D_INFO, "LMV object manager setup (%s)\n", obd->obd_uuid.uuid);
return 0;
}
struct lmv_obj *obj;
struct list_head *cur, *tmp;
- CWARN("LMV object manager cleanup (%s)\n",
- obd->obd_uuid.uuid);
+ CDEBUG(D_INFO, "LMV object manager cleanup (%s)\n", obd->obd_uuid.uuid);
spin_lock(&lmv_obj_list_lock);
list_for_each_safe(cur, tmp, &lmv_obj_list) {
de->name, (int) PTR_ERR(dentry));
goto next;
}
- LASSERT(dentry->d_inode != NULL);
rc = fsfilt_del_dir_entry(dc->obd, dentry);
l_dput(dentry);
next:
ENTRY;
/* TODO: optimization possible - we already may have mea here */
- if (mds_splitting_expected(obd, dentry) != MDS_EXPECT_SPLIT)
- RETURN(0);
+ rc = mds_splitting_expected(obd, dentry);
+ if (rc == MDS_NO_SPLITTABLE)
+ return 0;
+ if (rc == MDS_NO_SPLIT_EXPECTED && nstripes == 0)
+ return 0;
LASSERT(mea == NULL || *mea == NULL);
handle = fsfilt_start(obd, dir, FSFILT_OP_SETATTR, NULL);
if (IS_ERR(handle)) {
up(&dir->i_sem);
- CERROR("fsfilt_start() failed, error %d.\n",
- PTR_ERR(handle));
+ CERROR("fsfilt_start() failed: %d\n", (int) PTR_ERR(handle));
GOTO(err_oa, rc = PTR_ERR(handle));
}
/* 3) read through the dir and distribute it over objects */
rc = scan_and_distribute(obd, dentry, *mea);
+ if (mea == &tmea)
+ obd_free_diskmd(mds->mds_lmv_exp, (struct lov_mds_md **)mea);
if (rc) {
- CERROR("scan_and_distribute() failed, error %d.\n",
- rc);
+ CERROR("scan_and_distribute() failed, error %d.\n", rc);
RETURN(rc);
}
- if (mea == &tmea)
- obd_free_diskmd(mds->mds_lmv_exp,
- (struct lov_mds_md **)mea);
RETURN(1);
err_oa:
oa = obdo_alloc();
LASSERT(oa != NULL);
oa->o_mds = i;
+ oa->o_easize = 0;
+ if (rec->ur_eadata) {
+ /* user asks for creating splitted dir */
+ oa->o_easize = *((u16 *) rec->ur_eadata);
+ }
+
obdo_from_inode(oa, dir, OBD_MD_FLTYPE | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME |
OBD_MD_FLUID | OBD_MD_FLGID);
}
run_test 2b " list splitted dir after remount ============================="
+test_3a() {
+ mkdir $DIR/3a0 || error
+ for i in `seq 100`; do
+ mkdir $DIR/3a0/d${i} || error
+ done
+ createmany -o $DIR/3a0/f 5000 || error
+ rm -rf $DIR/3a0 || error
+}
+run_test 3a " dir splitting with cross-ref ============================="
+
TMPDIR=$OLDTMPDIR
TMP=$OLDTMP
HOME=$OLDHOME