Whamcloud - gitweb
- fixes about lmv_delete_inode().
authoryury <yury>
Mon, 15 Nov 2004 07:24:19 +0000 (07:24 +0000)
committeryury <yury>
Mon, 15 Nov 2004 07:24:19 +0000 (07:24 +0000)
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/llite/super.c
lustre/lmv/lmv_obd.c
lustre/tests/createmany.c

index 9ba9ec6..96106d7 100644 (file)
@@ -889,7 +889,7 @@ struct md_ops {
                                         int repoff);
         int (*m_set_lock_data)(struct obd_export *exp, __u64 *l, void *data);
 
-        int (*m_put_inode)(struct obd_export *, struct lustre_id *);
+        int (*m_delete_inode)(struct obd_export *, struct lustre_id *);
 
         /* NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line to
          * lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c. Also, add a
index 070e7d9..c1a0d5b 100644 (file)
@@ -1213,17 +1213,17 @@ static inline int md_getstatus(struct obd_export *exp, struct lustre_id *id)
         RETURN(rc);
 }
 
-static inline int md_put_inode(struct obd_export *exp,
-                               struct lustre_id *id)
+static inline int md_delete_inode(struct obd_export *exp,
+                                  struct lustre_id *id)
 {
         int rc;
         ENTRY;
 
-        if (MDP(exp->exp_obd, put_inode) == NULL)
+        if (MDP(exp->exp_obd, delete_inode) == NULL)
                 RETURN(0);
         
-        MD_COUNTER_INCREMENT(exp->exp_obd, put_inode);
-        rc = MDP(exp->exp_obd, put_inode)(exp, id);
+        MD_COUNTER_INCREMENT(exp->exp_obd, delete_inode);
+        rc = MDP(exp->exp_obd, delete_inode)(exp, id);
         RETURN(rc);
 }
 
index 8bb7439..781d122 100644 (file)
@@ -259,7 +259,7 @@ void ll_update_inode(struct inode *inode, struct lustre_md *);
 int it_disposition(struct lookup_intent *it, int flag);
 void it_set_disposition(struct lookup_intent *it, int flag);
 void ll_read_inode2(struct inode *inode, void *opaque);
-void ll_put_inode(struct inode *inode);
+void ll_delete_inode(struct inode *inode);
 int ll_iocontrol(struct inode *inode, struct file *file,
                  unsigned int cmd, unsigned long arg);
 void ll_umount_begin(struct super_block *sb);
index fd5686c..ab0f300 100644 (file)
@@ -1374,27 +1374,22 @@ void ll_read_inode2(struct inode *inode, void *opaque)
         }
 }
 
-void ll_put_inode(struct inode *inode)
+void ll_delete_inode(struct inode *inode)
 {
         struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct lustre_id id;
         int rc;
         ENTRY;
 
-        /* 
-         * notifying metadata target that any in memory data assosiated 
-         * with object @id should be removed. 
-         */
-        if (atomic_read(&inode->i_count) == 1) {
-                ll_inode2id(&id, inode);
+        ll_inode2id(&id, inode);
 
-                rc = md_put_inode(sbi->ll_lmv_exp, &id);
-                if (rc) {
-                        CERROR("md_put_inode() failed, error %d\n", 
-                               rc);
-                }
+        rc = md_delete_inode(sbi->ll_lmv_exp, &id);
+        if (rc) {
+                CERROR("md_delete_inode() failed, error %d\n", 
+                       rc);
         }
 
+        clear_inode(inode);
         EXIT;
 }
 
index f0e5ae1..00824b7 100644 (file)
@@ -562,8 +562,8 @@ static int ll_mknod_raw(struct nameidata *nd, int mode, dev_t rdev)
         RETURN(err);
 }
 
-static int ll_mknod(struct inode *dir, struct dentry *child, int mode,
-                    ll_dev_t rdev)
+static int ll_mknod(struct inode *dir, struct dentry *child,
+                    int mode, ll_dev_t rdev)
 {
         struct ptlrpc_request *request = NULL;
         struct inode *inode = NULL;
index 8598572..fcb89b0 100644 (file)
@@ -80,7 +80,7 @@ struct super_operations lustre_super_operations =
 {
         .read_inode2    = ll_read_inode2,
         .clear_inode    = ll_clear_inode,
-        .put_inode      = ll_put_inode,
+        .delete_inode   = ll_delete_inode,
         .put_super      = lustre_put_super,
         .statfs         = ll_statfs,
         .umount_begin   = ll_umount_begin,
index f9cd542..0e5bd5d 100644 (file)
@@ -1467,16 +1467,10 @@ int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data,
         RETURN(rc);
 }
 
-/*
- * commented for a while, as it will not work in the case when splitted dir is
- * created from ll_mkdir_stripe(), because mds_reint_create() returns 0 inthis
- * case even if there is created splitted dir with passed number of stripes. So
- * mds_reint_create() and lmv_create() need to be fixed first.
- */
-int lmv_put_inode(struct obd_export *exp, struct lustre_id *id)
+int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id)
 {
         ENTRY;
-//        lmv_delete_obj(exp, id);
+        lmv_delete_obj(exp, id);
         RETURN(0);
 }
 
@@ -1952,7 +1946,7 @@ struct md_ops lmv_md_ops = {
         .m_unlink              = lmv_unlink,
         .m_get_real_obd        = lmv_get_real_obd,
         .m_valid_attrs         = lmv_valid_attrs,
-        .m_put_inode           = lmv_put_inode,
+        .m_delete_inode        = lmv_delete_inode,
 };
 
 int __init lmv_init(void)
index 1d62b20..2bf9245 100644 (file)
@@ -73,7 +73,7 @@ int main(int argc, char ** argv)
         for (i = 0; i < count && time(0) < end; i++, begin++) {
                 sprintf(filename, fmt, begin);
                 if (do_open) {
-                        int fd = open(filename, O_CREAT|O_RDWR, 0644);
+                        int fd = open(filename, O_CREAT | O_RDWR, 0644);
                         if (fd < 0) {
                                 printf("open(%s) error: %s\n", filename,
                                        strerror(errno));
@@ -81,7 +81,7 @@ int main(int argc, char ** argv)
                                 break;
                         }
                         close(fd);
-               } else if (do_link) {
+                } else if (do_link) {
                         rc = link(tgt, filename);
                         if (rc) {
                                 printf("link(%s, %s) error: %s\n",
@@ -90,7 +90,7 @@ int main(int argc, char ** argv)
                                 break;
                         }
                 } else {
-                        rc = mknod(filename, S_IFREG| 0444, 0);
+                        rc = mknod(filename, S_IFREG | 0444, 0);
                         if (rc) {
                                 printf("mknod(%s) error: %s\n",
                                        filename, strerror(errno));