Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-13636 osd: create agent inode with explicit owner
[fs/lustre-release.git]
/
lustre
/
osd-ldiskfs
/
osd_handler.c
diff --git
a/lustre/osd-ldiskfs/osd_handler.c
b/lustre/osd-ldiskfs/osd_handler.c
index
6ccd372
..
c561425
100644
(file)
--- a/
lustre/osd-ldiskfs/osd_handler.c
+++ b/
lustre/osd-ldiskfs/osd_handler.c
@@
-957,8
+957,7
@@
static int osd_check_lmv(struct osd_thread_info *oti, struct osd_device *dev,
{
struct lu_buf *buf = &oti->oti_big_buf;
struct dentry *dentry = &oti->oti_obj_dentry;
- struct file *filp = &oti->oti_file;
- const struct file_operations *fops;
+ struct file *filp;
struct lmv_mds_md_v1 *lmv1;
struct osd_check_lmv_buf oclb = {
.ctx.actor = osd_stripe_dir_filldir,
@@
-1003,18
+1002,7
@@
again:
if (le32_to_cpu(lmv1->lmv_magic) != LMV_MAGIC_V1)
GOTO(out, rc = 0);
- fops = inode->i_fop;
- dentry->d_inode = inode;
- dentry->d_sb = inode->i_sb;
- filp->f_pos = 0;
- filp->f_path.dentry = dentry;
- filp->f_flags |= O_NOATIME;
- filp->f_mode = FMODE_64BITHASH | FMODE_NONOTIFY;
- filp->f_mapping = inode->i_mapping;
- filp->f_op = fops;
- filp->private_data = NULL;
- filp->f_cred = current_cred();
- filp->f_inode = inode;
+ filp = osd_quasi_file(oti->oti_env, inode);
rc = osd_security_file_alloc(filp);
if (rc)
goto out;
@@
-1024,7
+1012,7
@@
again:
rc = iterate_dir(filp, &oclb.ctx);
} while (rc >= 0 && oclb.oclb_items > 0 && !oclb.oclb_found &&
filp->f_pos != LDISKFS_HTREE_EOF_64BIT);
-
fops
->release(inode, filp);
+
inode->i_fop
->release(inode, filp);
out:
if (rc < 0)
@@
-1595,11
+1583,8
@@
static void osd_object_free(const struct lu_env *env, struct lu_object *l)
ldiskfs_htree_lock_head_free(obj->oo_hl_head);
/* obj doesn't contain an lu_object_header, so we don't need call_rcu */
OBD_FREE_PTR(obj);
- if (unlikely(h)) {
- lu_object_header_fini(h);
- OBD_FREE_PRE(h, sizeof(*h), "kfreed");
- kfree_rcu(h, loh_rcu);
- }
+ if (unlikely(h))
+ lu_object_header_free(h);
}
/*
@@
-2961,9
+2946,9
@@
static int osd_transfer_project(struct inode *inode, __u32 projid,
raw_inode = ldiskfs_raw_inode(&iloc);
if (!LDISKFS_FITS_IN_INODE(raw_inode, ei, i_projid)) {
- struct osd_thandle *oh =
-
container_of0(handle,
struct osd_thandle,
- ot_super);
+ struct osd_thandle *oh =
container_of(handle,
+
struct osd_thandle,
+
ot_super);
/**
* try to expand inode size automatically.
*/
@@
-3869,6
+3854,7
@@
static struct inode *osd_create_local_agent_inode(const struct lu_env *env,
struct osd_thread_info *info = osd_oti_get(env);
struct inode *local;
struct osd_thandle *oh;
+ uid_t own[2] = {0, 0};
int rc;
ENTRY;
@@
-3877,8
+3863,7
@@
static struct inode *osd_create_local_agent_inode(const struct lu_env *env,
oh = container_of(th, struct osd_thandle, ot_super);
LASSERT(oh->ot_handle->h_transaction != NULL);
- local = ldiskfs_create_inode(oh->ot_handle, pobj->oo_inode, type,
- NULL);
+ local = ldiskfs_create_inode(oh->ot_handle, pobj->oo_inode, type, own);
if (IS_ERR(local)) {
CERROR("%s: create local error %d\n", osd_name(osd),
(int)PTR_ERR(local));
@@
-4830,20
+4815,11
@@
static int osd_object_sync(const struct lu_env *env, struct dt_object *dt,
{
struct osd_object *obj = osd_dt_obj(dt);
struct inode *inode = obj->oo_inode;
- struct osd_thread_info *info = osd_oti_get(env);
- struct dentry *dentry = &info->oti_obj_dentry;
- struct file *file = &info->oti_file;
+ struct file *file = osd_quasi_file(env, inode);
int rc;
ENTRY;
- dentry->d_inode = inode;
- dentry->d_sb = inode->i_sb;
- file->f_path.dentry = dentry;
- file->f_mapping = inode->i_mapping;
- file->f_op = inode->i_fop;
- file->f_inode = inode;
-
rc = vfs_fsync_range(file, start, end, 0);
RETURN(rc);
@@
-7298,8
+7274,6
@@
static inline int osd_it_ea_rec(const struct lu_env *env,
rc = osd_ea_fid_get(env, obj, ino, fid, id);
}
- } else {
- osd_id_gen(id, ino, OSD_OII_NOGEN);
}
}
@@
-7309,15
+7283,6
@@
static inline int osd_it_ea_rec(const struct lu_env *env,
it->oie_dirent->oied_namelen,
it->oie_dirent->oied_type, attr);
- if (rc < 0)
- RETURN(rc);
-
- if (osd_remote_fid(env, dev, fid))
- RETURN(0);
-
- if (likely(!(attr & (LUDA_IGNORE | LUDA_UNKNOWN)) && rc == 0))
- osd_add_oi_cache(oti, dev, id, fid);
-
RETURN(rc > 0 ? 0 : rc);
}