staging: lustre: llite: remove lli_has_smd
Remove the lli_has_smd flag from struct ll_inode_info. The empty layout case will be handled by the LOV layer. Remove the unused function cl_local_size(). Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814 Reviewed-on: http://review.whamcloud.com/13690 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
55554f31e9
Коммит
85cb63bc68
|
@ -632,12 +632,6 @@ restart:
|
|||
if (!S_ISREG(inode->i_mode))
|
||||
goto out_och_free;
|
||||
|
||||
if (!lli->lli_has_smd &&
|
||||
(cl_is_lov_delay_create(file->f_flags) ||
|
||||
(file->f_mode & FMODE_WRITE) == 0)) {
|
||||
CDEBUG(D_INODE, "object creation was delayed\n");
|
||||
goto out_och_free;
|
||||
}
|
||||
cl_lov_delay_create_clear(&file->f_flags);
|
||||
goto out_och_free;
|
||||
|
||||
|
@ -3185,7 +3179,6 @@ int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf)
|
|||
PFID(&lli->lli_fid), ll_layout_version_get(lli),
|
||||
cl.cl_layout_gen);
|
||||
ll_layout_version_set(lli, cl.cl_layout_gen);
|
||||
lli->lli_has_smd = lsm_has_objects(conf->u.coc_md->lsm);
|
||||
}
|
||||
out:
|
||||
cl_env_nested_put(&nest, env);
|
||||
|
|
|
@ -80,14 +80,12 @@ blkcnt_t dirty_cnt(struct inode *inode)
|
|||
int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
|
||||
struct inode *inode, struct cl_object *clob, int agl)
|
||||
{
|
||||
struct ll_inode_info *lli = ll_i2info(inode);
|
||||
const struct lu_fid *fid = lu_object_fid(&clob->co_lu);
|
||||
struct cl_lock *lock = vvp_env_lock(env);
|
||||
struct cl_lock_descr *descr = &lock->cll_descr;
|
||||
int result = 0;
|
||||
|
||||
CDEBUG(D_DLMTRACE, "Glimpsing inode " DFID "\n", PFID(fid));
|
||||
if (lli->lli_has_smd) {
|
||||
struct cl_lock *lock = vvp_env_lock(env);
|
||||
struct cl_lock_descr *descr = &lock->cll_descr;
|
||||
|
||||
/* NOTE: this looks like DLM lock request, but it may
|
||||
* not be one. Due to CEF_ASYNC flag (translated
|
||||
|
@ -135,10 +133,6 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
|
|||
}
|
||||
|
||||
cl_lock_release(env, lock);
|
||||
} else {
|
||||
CDEBUG(D_DLMTRACE, "No objects for inode\n");
|
||||
ll_merge_attr(env, inode);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -209,39 +203,3 @@ again:
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int cl_local_size(struct inode *inode)
|
||||
{
|
||||
struct lu_env *env = NULL;
|
||||
struct cl_io *io = NULL;
|
||||
struct cl_object *clob;
|
||||
int result;
|
||||
int refcheck;
|
||||
|
||||
if (!ll_i2info(inode)->lli_has_smd)
|
||||
return 0;
|
||||
|
||||
result = cl_io_get(inode, &env, &io, &refcheck);
|
||||
if (result <= 0)
|
||||
return result;
|
||||
|
||||
clob = io->ci_obj;
|
||||
result = cl_io_init(env, io, CIT_MISC, clob);
|
||||
if (result > 0) {
|
||||
result = io->ci_result;
|
||||
} else if (result == 0) {
|
||||
struct cl_lock *lock = vvp_env_lock(env);
|
||||
|
||||
lock->cll_descr = whole_file;
|
||||
lock->cll_descr.cld_enq_flags = CEF_PEEK;
|
||||
lock->cll_descr.cld_obj = clob;
|
||||
result = cl_lock_request(env, io, lock);
|
||||
if (result == 0) {
|
||||
ll_merge_attr(env, inode);
|
||||
cl_lock_release(env, lock);
|
||||
}
|
||||
}
|
||||
cl_io_fini(env, io);
|
||||
cl_env_put(env, &refcheck);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -184,7 +184,6 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
|
|||
* locked by I_NEW bit.
|
||||
*/
|
||||
lli->lli_clob = clob;
|
||||
lli->lli_has_smd = lsm_has_objects(md->lsm);
|
||||
lu_object_ref_add(&clob->co_lu, "inode", inode);
|
||||
} else {
|
||||
result = PTR_ERR(clob);
|
||||
|
|
|
@ -226,7 +226,6 @@ struct ll_inode_info {
|
|||
* In the future, if more members are added only for directory,
|
||||
* some of the following members can be moved into u.f.
|
||||
*/
|
||||
bool lli_has_smd;
|
||||
struct cl_object *lli_clob;
|
||||
|
||||
/* mutex to request for layout lock exclusively. */
|
||||
|
@ -1337,7 +1336,6 @@ extern int cl_inode_fini_refcheck;
|
|||
|
||||
int cl_file_inode_init(struct inode *inode, struct lustre_md *md);
|
||||
void cl_inode_fini(struct inode *inode);
|
||||
int cl_local_size(struct inode *inode);
|
||||
|
||||
__u64 cl_fid_build_ino(const struct lu_fid *fid, int api32);
|
||||
__u32 cl_fid_build_gen(const struct lu_fid *fid);
|
||||
|
|
|
@ -798,7 +798,6 @@ void ll_lli_init(struct ll_inode_info *lli)
|
|||
lli->lli_open_fd_exec_count = 0;
|
||||
mutex_init(&lli->lli_och_mutex);
|
||||
spin_lock_init(&lli->lli_agl_lock);
|
||||
lli->lli_has_smd = false;
|
||||
spin_lock_init(&lli->lli_layout_lock);
|
||||
ll_layout_version_set(lli, CL_LAYOUT_GEN_NONE);
|
||||
lli->lli_clob = NULL;
|
||||
|
@ -1290,7 +1289,6 @@ void ll_clear_inode(struct inode *inode)
|
|||
* cl_object still uses inode lsm.
|
||||
*/
|
||||
cl_inode_fini(inode);
|
||||
lli->lli_has_smd = false;
|
||||
}
|
||||
|
||||
#define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
|
||||
|
@ -1688,8 +1686,6 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
|
|||
|
||||
LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));
|
||||
if (lsm) {
|
||||
if (!lli->lli_has_smd &&
|
||||
!(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
|
||||
cl_file_inode_init(inode, md);
|
||||
|
||||
lli->lli_maxbytes = lsm->lsm_maxbytes;
|
||||
|
@ -1802,8 +1798,6 @@ int ll_read_inode2(struct inode *inode, void *opaque)
|
|||
CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n",
|
||||
PFID(&lli->lli_fid), inode);
|
||||
|
||||
LASSERT(!lli->lli_has_smd);
|
||||
|
||||
/* Core attributes from the MDS first. This is a new inode, and
|
||||
* the VFS doesn't zero times in the core inode so we have to do
|
||||
* it ourselves. They will be overwritten by either MDS or OST
|
||||
|
|
|
@ -347,13 +347,9 @@ static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter)
|
|||
loff_t file_offset = iocb->ki_pos;
|
||||
ssize_t count = iov_iter_count(iter);
|
||||
ssize_t tot_bytes = 0, result = 0;
|
||||
struct ll_inode_info *lli = ll_i2info(inode);
|
||||
long size = MAX_DIO_SIZE;
|
||||
int refcheck;
|
||||
|
||||
if (!lli->lli_has_smd)
|
||||
return -EBADF;
|
||||
|
||||
/* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */
|
||||
if ((file_offset & ~PAGE_MASK) || (count & ~PAGE_MASK))
|
||||
return -EINVAL;
|
||||
|
|
|
@ -145,27 +145,8 @@ static int vvp_conf_set(const struct lu_env *env, struct cl_object *obj,
|
|||
*/
|
||||
unmap_mapping_range(conf->coc_inode->i_mapping,
|
||||
0, OBD_OBJECT_EOF, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (conf->coc_opc != OBJECT_CONF_SET)
|
||||
return 0;
|
||||
|
||||
if (conf->u.coc_md && conf->u.coc_md->lsm) {
|
||||
CDEBUG(D_VFSTRACE, DFID ": layout version change: %u -> %u\n",
|
||||
PFID(&lli->lli_fid), lli->lli_layout_gen,
|
||||
conf->u.coc_md->lsm->lsm_layout_gen);
|
||||
|
||||
lli->lli_has_smd = lsm_has_objects(conf->u.coc_md->lsm);
|
||||
ll_layout_version_set(lli, conf->u.coc_md->lsm->lsm_layout_gen);
|
||||
} else {
|
||||
CDEBUG(D_VFSTRACE, DFID ": layout nuked: %u.\n",
|
||||
PFID(&lli->lli_fid), lli->lli_layout_gen);
|
||||
|
||||
lli->lli_has_smd = false;
|
||||
ll_layout_version_set(lli, CL_LAYOUT_GEN_EMPTY);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -918,6 +918,13 @@ static void lov_empty_io_fini(const struct lu_env *env,
|
|||
wake_up_all(&lov->lo_waitq);
|
||||
}
|
||||
|
||||
static int lov_empty_io_submit(const struct lu_env *env,
|
||||
const struct cl_io_slice *ios,
|
||||
enum cl_req_type crt, struct cl_2queue *queue)
|
||||
{
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
static void lov_empty_impossible(const struct lu_env *env,
|
||||
struct cl_io_slice *ios)
|
||||
{
|
||||
|
@ -968,7 +975,7 @@ static const struct cl_io_operations lov_empty_io_ops = {
|
|||
.cio_fini = lov_empty_io_fini
|
||||
}
|
||||
},
|
||||
.cio_submit = LOV_EMPTY_IMPOSSIBLE,
|
||||
.cio_submit = lov_empty_io_submit,
|
||||
.cio_commit_async = LOV_EMPTY_IMPOSSIBLE
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче