Whamcloud - gitweb
LU-5014 osd-ldiskfs: vfs_unlink api changed
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_compat.c
index 6ec1129..d01748d 100644 (file)
@@ -183,7 +183,6 @@ static int osd_mdt_init(const struct lu_env *env, struct osd_device *dev)
        if (IS_ERR(d))
                GOTO(cleanup, rc = PTR_ERR(d));
 
-       ldiskfs_set_inode_state(d->d_inode, LDISKFS_STATE_LUSTRE_NO_OI);
        omm->omm_remote_parent = d;
 
        /* Set LMA for remote parent inode */
@@ -378,7 +377,7 @@ static int osd_ost_init(const struct lu_env *env, struct osd_device *dev)
 
        CFS_INIT_LIST_HEAD(&dev->od_ost_map->om_seq_list);
        rwlock_init(&dev->od_ost_map->om_seq_list_lock);
-       sema_init(&dev->od_ost_map->om_dir_init_sem, 1);
+       mutex_init(&dev->od_ost_map->om_dir_init_mutex);
 
         osd_push_ctxt(dev, &new, &save);
 
@@ -399,7 +398,6 @@ static int osd_ost_init(const struct lu_env *env, struct osd_device *dev)
        }
 
        inode = d->d_inode;
-       ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NO_OI);
        dev->od_ost_map->om_root = d;
 
        /* 'What the @fid is' is not imporatant, because the object
@@ -741,7 +739,6 @@ static int osd_seq_load_locked(struct osd_thread_info *info,
                GOTO(out_put, rc = -EFAULT);
 
        inode = seq_dir->d_inode;
-       ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NO_OI);
        osd_seq->oos_root = seq_dir;
 
        /* 'What the @fid is' is not imporatant, because the object
@@ -772,7 +769,6 @@ static int osd_seq_load_locked(struct osd_thread_info *info,
                }
 
                inode = dir->d_inode;
-               ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NO_OI);
                osd_seq->oos_dirs[i] = dir;
 
                /* 'What the @fid is' is not imporatant, because the object
@@ -817,7 +813,7 @@ static struct osd_obj_seq *osd_seq_load(struct osd_thread_info *info,
                RETURN(osd_seq);
 
        /* Serializing init process */
-       down(&map->om_dir_init_sem);
+       mutex_lock(&map->om_dir_init_mutex);
 
        /* Check whether the seq has been added */
        read_lock(&map->om_seq_list_lock);
@@ -846,7 +842,7 @@ static struct osd_obj_seq *osd_seq_load(struct osd_thread_info *info,
        write_unlock(&map->om_seq_list_lock);
 
 cleanup:
-       up(&map->om_dir_init_sem);
+       mutex_unlock(&map->om_dir_init_mutex);
        if (rc != 0) {
                if (osd_seq != NULL)
                        OBD_FREE_PTR(osd_seq);
@@ -1108,7 +1104,7 @@ int osd_obj_map_recover(struct osd_thread_info *info,
                /* If the src object has never been modified, then remove it. */
                if (inode->i_size == 0 && inode->i_mode & S_ISUID &&
                    inode->i_mode & S_ISGID) {
-                       rc = vfs_unlink(src_parent, src_child);
+                       rc = ll_vfs_unlink(src_parent, src_child);
                        if (unlikely(rc == -ENOENT))
                                rc = 0;
                }
@@ -1168,7 +1164,7 @@ int osd_obj_spec_update(struct osd_thread_info *info, struct osd_device *osd,
                        handle_t *th)
 {
        struct dentry   *root;
-       char            *name;
+       char            *name = NULL;
        int              rc;
        ENTRY;
 
@@ -1189,7 +1185,7 @@ int osd_obj_spec_insert(struct osd_thread_info *info, struct osd_device *osd,
                        handle_t *th)
 {
        struct dentry   *root;
-       char            *name;
+       char            *name = NULL;
        int              rc;
        ENTRY;
 
@@ -1211,7 +1207,7 @@ int osd_obj_spec_lookup(struct osd_thread_info *info, struct osd_device *osd,
        struct dentry   *root;
        struct dentry   *dentry;
        struct inode    *inode;
-       char            *name;
+       char            *name = NULL;
        int             rc = -ENOENT;
        ENTRY;