*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/osd/osd_compat.c
*
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;
RETURN(dchild);
}
- err = vfs_mkdir(dir->d_inode, dchild, mode);
+ err = vfs_mkdir(&init_user_ns, dir->d_inode, dchild, mode);
if (err)
GOTO(out_err, err);
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)
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;
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;
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,
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;
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);
}
/* 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 = ll_vfs_unlink(src_parent, src_child);
+ rc = vfs_unlink(&init_user_ns, src_parent, src_child);
if (unlikely(rc == -ENOENT))
rc = 0;
}