Whamcloud - gitweb
Branch: HEAD
[fs/lustre-release.git] / lustre / smfs / mds_kml.c
index 6b57a4d..54ad1ad 100644 (file)
@@ -27,6 +27,7 @@
 #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>
@@ -53,7 +54,8 @@ static int mds_rec_link_pack(char *buffer, struct dentry *dentry,
                 return -ENOMEM;
         
         mdc_prepare_mdc_data(op_data, src->d_inode, dir,
-                             tgt->d_name.name, tgt->d_name.len, 0);
+                             (char *)tgt->d_name.name,
+                             tgt->d_name.len, 0);
 
         PACK_KML_REC_INIT(buffer, MDS_REINT);
         mkpi = (struct mds_kml_pack_info *)buffer;
@@ -133,6 +135,8 @@ static int mds_rec_create_pack(char *buffer, struct dentry *dentry,
         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;
 
@@ -141,9 +145,13 @@ static int mds_rec_create_pack(char *buffer, struct dentry *dentry,
         OBD_ALLOC(op_data, sizeof(*op_data));
         if (op_data == NULL)
                 return -ENOMEM;
+        
         mdc_prepare_mdc_data(op_data, dir, dentry->d_inode,
-                             dentry->d_name.name, dentry->d_name.len, 0);
+                             (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;
 
@@ -190,8 +198,9 @@ static int mds_rec_unlink_pack(char *buffer, struct dentry *dentry,
         OBD_ALLOC(op_data, sizeof(*op_data));
         if (op_data == NULL)
                 return -ENOMEM;
+        
         mdc_prepare_mdc_data(op_data, dir, NULL,
-                             dentry->d_name.name,
+                             (char *)dentry->d_name.name,
                              dentry->d_name.len, mode);
 
         PACK_KML_REC_INIT(buffer, MDS_REINT);
@@ -244,8 +253,8 @@ static int mds_rec_rename_pack(char *buffer, struct dentry *dentry,
         msg = (struct lustre_msg *)(buffer + sizeof(*mkpi));
         lustre_init_msg(msg, mkpi->mpi_bufcount, mkpi->mpi_size, NULL);
 
-        tmp = mdc_rename_pack(msg, 0, op_data, dentry->d_name.name,
-                              dentry->d_name.len, new_dentry->d_name.name,
+        tmp = mdc_rename_pack(msg, 0, op_data, (char *)dentry->d_name.name,
+                              dentry->d_name.len, (char *)new_dentry->d_name.name,
                               new_dentry->d_name.len);
 
         mkpi->mpi_total_size = tmp - (void*)msg;
@@ -271,3 +280,4 @@ int mds_rec_pack(int op, char *buffer, struct dentry *dentry,
 }
 
 
+