Whamcloud - gitweb
LU-13124 scrub: check for multiple linked file
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_compat.c
index 8b70faf..7c8aee1 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/osd/osd_compat.c
  *
@@ -59,7 +58,6 @@ static void osd_push_ctxt(const struct osd_device *dev,
        OBD_SET_CTXT_MAGIC(newctxt);
        newctxt->pwdmnt = dev->od_mnt;
        newctxt->pwd = dev->od_mnt->mnt_root;
-       newctxt->fs = KERNEL_DS;
        newctxt->umask = current_umask();
        newctxt->dt = NULL;
 
@@ -611,10 +609,8 @@ static int osd_index_backup_dir_init(const struct lu_env *env,
 
 static void osd_index_backup_dir_fini(struct osd_device *dev)
 {
-       if (dev->od_index_backup_inode) {
-               iput(dev->od_index_backup_inode);
-               dev->od_index_backup_inode = NULL;
-       }
+       iput(dev->od_index_backup_inode);
+       dev->od_index_backup_inode = NULL;
 }
 
 int osd_obj_map_init(const struct lu_env *env, struct osd_device *dev)
@@ -830,10 +826,9 @@ out:
        return rc;
 }
 
-static int osd_obj_del_entry(struct osd_thread_info *info,
-                            struct osd_device *osd,
-                            struct dentry *dird, char *name,
-                            handle_t *th)
+int osd_obj_del_entry(struct osd_thread_info *info, struct osd_device *osd,
+                     struct dentry *dird, char *name, int namelen,
+                     handle_t *th)
 {
        struct ldiskfs_dir_entry_2 *de;
        struct buffer_head *bh;
@@ -849,7 +844,7 @@ static int osd_obj_del_entry(struct osd_thread_info *info,
        child = &info->oti_child_dentry;
        child->d_name.hash = 0;
        child->d_name.name = name;
-       child->d_name.len = strlen(name);
+       child->d_name.len = namelen;
        child->d_parent = dird;
        child->d_inode = NULL;
 
@@ -932,15 +927,6 @@ static inline void osd_seq_name(char *seq_name, size_t name_size, u64 seq)
                 fid_seq_is_idif(seq) ? 0 : seq);
 }
 
-static inline void osd_oid_name(char *name, size_t name_size,
-                               const struct lu_fid *fid, u64 id)
-{
-       snprintf(name, name_size,
-                (fid_seq_is_rsvd(fid_seq(fid)) ||
-                 fid_seq_is_mdt0(fid_seq(fid)) ||
-                 fid_seq_is_idif(fid_seq(fid))) ? "%llu" : "%llx", id);
-}
-
 /* external locking is required */
 static int osd_seq_load_locked(struct osd_thread_info *info,
                               struct osd_device *osd,
@@ -1009,8 +995,8 @@ out_err:
        RETURN(rc);
 }
 
-static struct osd_obj_seq *osd_seq_load(struct osd_thread_info *info,
-                                       struct osd_device *osd, u64 seq)
+struct osd_obj_seq *osd_seq_load(struct osd_thread_info *info,
+                                struct osd_device *osd, u64 seq)
 {
        struct osd_obj_map *map;
        struct osd_obj_seq *osd_seq;
@@ -1204,7 +1190,7 @@ int osd_obj_map_delete(struct osd_thread_info *info, struct osd_device *osd,
        LASSERT(d);
 
        osd_oid_name(name, sizeof(name), fid, ostid_id(ostid));
-       rc = osd_obj_del_entry(info, osd, d, name, th);
+       rc = osd_obj_del_entry(info, osd, d, name, strlen(name), th);
 cleanup:
        RETURN(rc);
 }