-Index: uml-2.6.3/include/linux/dcache.h
+Index: linux-2.6.10/include/linux/dcache.h
===================================================================
---- uml-2.6.3.orig/include/linux/dcache.h 2004-02-21 00:19:14.365988600 +0800
-+++ uml-2.6.3/include/linux/dcache.h 2004-02-21 00:21:04.612228624 +0800
-@@ -25,6 +25,11 @@
+--- linux-2.6.10.orig/include/linux/dcache.h 2005-07-11 17:33:07.000000000 +0800
++++ linux-2.6.10/include/linux/dcache.h 2005-07-15 15:05:14.000000000 +0800
+@@ -24,6 +24,13 @@
#define IS_ROOT(x) ((x) == (x)->d_parent)
+struct dentry_params {
+ unsigned long p_inum;
+ void *p_ptr;
++ __u64 p_fid;
++ __u64 p_group;
+};
+
/*
struct mea *mea;
void *handle = NULL;
unsigned long cr_inum = 0;
+ __u64 fid = 0;
ENTRY;
DEBUG_REQ(D_HA, req, "create remote object");
CERROR("%s: name exists. repeat\n", obd->obd_name);
goto repeat;
}
-
+ if ((body->oa.o_flags & OBD_FL_RECREATE_OBJS) ||
+ lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
+ fid = body->oa.o_fid;
+ } else {
+ fid = mds_alloc_fid(obd);
+ }
new->d_fsdata = (void *)&dp;
dp.p_inum = 0;
dp.p_ptr = req;
+ dp.p_fid = fid;
+ dp.p_group = mds->mds_num;
if ((lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) ||
(body->oa.o_flags & OBD_FL_RECREATE_OBJS)) {
* and this is not replay.
*/
down(&new->d_inode->i_sem);
- rc = mds_alloc_inode_sid(obd, new->d_inode, handle, &id);
+ rc = mds_set_inode_sid(obd, new->d_inode, handle, &id, fid);
up(&new->d_inode->i_sem);
}
if (rc) {
return fid;
}
-
/*
- * allocates new lustre_id on passed @inode and saves it to inode EA.
+ * update new lustre_id on passed @inode and saves it to inode EA.
*/
-int mds_alloc_inode_sid(struct obd_device *obd, struct inode *inode,
- void *handle, struct lustre_id *id)
+int mds_set_inode_sid(struct obd_device *obd, struct inode *inode,
+ void *handle, struct lustre_id *id, __u64 fid)
{
struct mds_obd *mds = &obd->u.mds;
int alloc = 0, rc = 0;
RETURN(-ENOMEM);
alloc = 1;
}
-
id_group(id) = mds->mds_num;
- id_fid(id) = mds_alloc_fid(obd);
+ id_fid(id) = fid;
id_ino(id) = inode->i_ino;
id_gen(id) = inode->i_generation;
id_type(id) = (S_IFMT & inode->i_mode);
struct inode *inode;
struct dentry *dentry;
struct mds_obd *mds = &obd->u.mds;
+ __u64 fid;
ENTRY;
/* getting root directory and setup its fid. */
GOTO(out_dentry, rc);
}
+ fid = mds_alloc_fid(obd);
down(&inode->i_sem);
- rc = mds_alloc_inode_sid(obd, inode, handle, &mds->mds_rootid);
+ rc = mds_set_inode_sid(obd, inode, handle, &mds->mds_rootid, fid);
up(&inode->i_sem);
if (rc) {
- CERROR("mds_alloc_inode_sid() failed, rc = %d\n",
+ CERROR("mds_set_inode_sid() failed, rc = %d\n",
rc);
GOTO(out_dentry, rc);
}
__u64 mds_alloc_fid(struct obd_device *obd);
-int mds_alloc_inode_sid(struct obd_device *, struct inode *,
- void *, struct lustre_id *);
+int mds_set_inode_sid(struct obd_device *, struct inode *,
+ void *, struct lustre_id *, __u64 fid);
int mds_update_inode_sid(struct obd_device *, struct inode *,
void *, struct lustre_id *);
struct mea *mea = NULL;
int mea_size, update_mode;
int child_mode = LCK_PR;
+ __u64 fid = 0;
ENTRY;
DEBUG_REQ(D_INODE, req, "parent "DLID4" name %*s mode %o",
handle = NULL;
GOTO(cleanup, rc);
}
+ if (ino)
+ fid = id_fid(rec->ur_id2);
+ else
+ fid = mds_alloc_fid(obd);
dchild->d_fsdata = (void *) &dp;
dp.p_ptr = req;
dp.p_inum = ino;
+ dp.p_fid = fid;
+ dp.p_group = mds->mds_num;
rc = ll_vfs_create(dparent->d_inode, dchild, rec->ur_mode, NULL);
if (dchild->d_fsdata == (void *)(unsigned long)ino)
"rc = %d\n", rc);
}
id_assign_fid(&body->id1, rec->ur_id2);
-
/*
* make sure, that fid is up-to-date.
*/
mds_set_last_fid(obd, id_fid(rec->ur_id2));
} else {
- rc = mds_alloc_inode_sid(obd, dchild->d_inode,
- handle, &body->id1);
+ rc = mds_set_inode_sid(obd, dchild->d_inode,
+ handle, &body->id1, fid);
if (rc) {
- CERROR("mds_alloc_inode_sid() failed, "
+ CERROR("mds_set_inode_sid() failed, "
"rc = %d\n", rc);
}
}
struct dentry_params dp;
struct mea *mea = NULL;
int mea_size;
+ __u64 fid;
ENTRY;
LASSERT(offset == 1);
* needed to check if object already created in the case of creating
* remote inode.
*/
+ if (id_ino(rec->ur_id2))
+ fid = id_fid(rec->ur_id2);
+ else
+ fid = mds_alloc_fid(obd);
dchild->d_fsdata = (void *)&dp;
dp.p_inum = (unsigned long)id_ino(rec->ur_id2);
dp.p_ptr = req;
+ dp.p_fid = fid;
+ dp.p_group = mds->mds_num;
switch (type) {
case S_IFREG: {
*/
mds_set_last_fid(obd, id_fid(rec->ur_id2));
} else {
- rc = mds_alloc_inode_sid(obd, dchild->d_inode,
- handle, NULL);
+ rc = mds_set_inode_sid(obd, dchild->d_inode,
+ handle, NULL, fid);
if (rc) {
- CERROR("mds_alloc_inode_sid() failed, inode %lu, "
+ CERROR("mds_set_inode_sid() failed, inode %lu, "
"rc %d\n", dchild->d_inode->i_ino, rc);
}
}
* because for dir it was already done.
*/
down(&inode->i_sem);
- rc = mds_alloc_inode_sid(obd, inode,
- handle, NULL);
+ rc = mds_set_inode_sid(obd, inode,
+ handle, NULL, fid);
up(&inode->i_sem);
if (rc) {
- CERROR("mds_alloc_inode_sid() failed, "
+ CERROR("mds_set_inode_sid() failed, "
"inode %lu, rc %d\n", inode->i_ino,
rc);
}
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/slab.h>
+#include <linux/dcache.h>
#include <linux/obd_class.h>
#include <linux/obd_support.h>
#include <linux/lustre_lib.h>
struct lustre_msg *msg = NULL;
struct mdc_op_data *op_data;
struct mds_rec_create *rec;
+ struct dentry_params *param =
+ (struct dentry_params *) dentry->d_fsdata;
int rc = 0, tgt_len = 0;
void *tmp = NULL;
(char *)dentry->d_name.name,
dentry->d_name.len, 0);
+ id_fid(&op_data->id1) = param->p_fid;
+ id_group(&op_data->id1) = param->p_group;
PACK_KML_REC_INIT(buffer, MDS_REINT);
mkpi = (struct mds_kml_pack_info *)buffer;