Commit ef2e0f55 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre: Remove mds/ost capabilities support

Client capabilities is an outdated feature that never worked properly,
so let's get rid of the client support since modern servers
don't have this support either.

The patch is big, but since it just removes one large feature,
so it's hopefully easy to verify.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3598094
......@@ -2335,7 +2335,6 @@ struct cl_io {
struct cl_setattr_io {
struct ost_lvb sa_attr;
unsigned int sa_valid;
struct obd_capa *sa_capa;
} ci_setattr;
struct cl_fault_io {
/** page index within file. */
......@@ -2354,7 +2353,6 @@ struct cl_io {
struct cl_fsync_io {
loff_t fi_start;
loff_t fi_end;
struct obd_capa *fi_capa;
/** file system level fid */
struct lu_fid *fi_fid;
enum cl_fsync_mode fi_mode;
......@@ -2473,8 +2471,6 @@ struct cl_io {
struct cl_req_attr {
/** Generic attributes for the server consumption. */
struct obdo *cra_oa;
/** Capability. */
struct obd_capa *cra_capa;
/** Jobid */
char cra_jobid[JOBSTATS_JOBID_SIZE];
};
......
......@@ -371,8 +371,7 @@ struct page *cl2vm_page (const struct cl_page_slice *slice);
struct inode *ccc_object_inode(const struct cl_object *obj);
struct ccc_object *cl_inode2ccc (struct inode *inode);
int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
struct obd_capa *capa);
int cl_setattr_ost(struct inode *inode, const struct iattr *attr);
struct cl_page *ccc_vmpage_page_transient(struct page *vmpage);
int ccc_object_invariant(const struct cl_object *obj);
......
......@@ -3509,30 +3509,6 @@ enum {
#define CAPA_OPC_MDS_DEFAULT ~CAPA_OPC_OSS_ONLY
#define CAPA_OPC_OSS_DEFAULT ~(CAPA_OPC_MDS_ONLY | CAPA_OPC_OSS_ONLY)
/* MDS capability covers object capability for operations of body r/w
* (dir readpage/sendpage), index lookup/insert/delete and meta data r/w,
* while OSS capability only covers object capability for operations of
* oss data(file content) r/w/truncate.
*/
static inline int capa_for_mds(struct lustre_capa *c)
{
return (c->lc_opc & CAPA_OPC_INDEX_LOOKUP) != 0;
}
static inline int capa_for_oss(struct lustre_capa *c)
{
return (c->lc_opc & CAPA_OPC_INDEX_LOOKUP) == 0;
}
/* lustre_capa::lc_hmac_alg */
enum {
CAPA_HMAC_ALG_SHA1 = 1, /**< sha1 algorithm */
CAPA_HMAC_ALG_MAX,
};
#define CAPA_FL_MASK 0x00ffffff
#define CAPA_HMAC_ALG_MASK 0xff000000
struct lustre_capa_key {
__u64 lk_seq; /**< mds# */
__u32 lk_keyid; /**< key# */
......
/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
* GPL HEADER END
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/include/lustre_capa.h
*
* Author: Lai Siyao <lsy@clusterfs.com>
*/
#ifndef __LINUX_CAPA_H_
#define __LINUX_CAPA_H_
/** \defgroup capa capa
*
* @{
*/
/*
* capability
*/
#include <linux/crypto.h>
#include "lustre/lustre_idl.h"
#define CAPA_TIMEOUT 1800 /* sec, == 30 min */
#define CAPA_KEY_TIMEOUT (24 * 60 * 60) /* sec, == 1 days */
struct capa_hmac_alg {
const char *ha_name;
int ha_len;
int ha_keylen;
};
#define DEF_CAPA_HMAC_ALG(name, type, len, keylen) \
[CAPA_HMAC_ALG_ ## type] = { \
.ha_name = name, \
.ha_len = len, \
.ha_keylen = keylen, \
}
struct client_capa {
struct inode *inode;
struct list_head lli_list; /* link to lli_oss_capas */
};
struct target_capa {
struct hlist_node c_hash; /* link to capa hash */
};
struct obd_capa {
struct list_head c_list; /* link to capa_list */
struct lustre_capa c_capa; /* capa */
atomic_t c_refc; /* ref count */
unsigned long c_expiry; /* jiffies */
spinlock_t c_lock; /* protect capa content */
int c_site;
union {
struct client_capa cli;
struct target_capa tgt;
} u;
};
enum {
CAPA_SITE_CLIENT = 0,
CAPA_SITE_SERVER,
CAPA_SITE_MAX
};
static inline struct lu_fid *capa_fid(struct lustre_capa *capa)
{
return &capa->lc_fid;
}
static inline __u64 capa_opc(struct lustre_capa *capa)
{
return capa->lc_opc;
}
static inline __u64 capa_uid(struct lustre_capa *capa)
{
return capa->lc_uid;
}
static inline __u64 capa_gid(struct lustre_capa *capa)
{
return capa->lc_gid;
}
static inline __u32 capa_flags(struct lustre_capa *capa)
{
return capa->lc_flags & 0xffffff;
}
static inline __u32 capa_alg(struct lustre_capa *capa)
{
return (capa->lc_flags >> 24);
}
static inline __u32 capa_keyid(struct lustre_capa *capa)
{
return capa->lc_keyid;
}
static inline __u64 capa_key_seq(struct lustre_capa_key *key)
{
return key->lk_seq;
}
static inline __u32 capa_key_keyid(struct lustre_capa_key *key)
{
return key->lk_keyid;
}
static inline __u32 capa_timeout(struct lustre_capa *capa)
{
return capa->lc_timeout;
}
static inline __u32 capa_expiry(struct lustre_capa *capa)
{
return capa->lc_expiry;
}
void _debug_capa(struct lustre_capa *, struct libcfs_debug_msg_data *,
const char *fmt, ...);
#define DEBUG_CAPA(level, capa, fmt, args...) \
do { \
if (((level) & D_CANTMASK) != 0 || \
((libcfs_debug & (level)) != 0 && \
(libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, NULL); \
_debug_capa((capa), &msgdata, fmt, ##args); \
} \
} while (0)
#define DEBUG_CAPA_KEY(level, k, fmt, args...) \
do { \
CDEBUG(level, fmt " capability key@%p seq %llu keyid %u\n", \
##args, k, capa_key_seq(k), capa_key_keyid(k)); \
} while (0)
typedef int (*renew_capa_cb_t)(struct obd_capa *, struct lustre_capa *);
/* obdclass/capa.c */
extern struct list_head capa_list[];
extern spinlock_t capa_lock;
extern int capa_count[];
extern struct kmem_cache *capa_cachep;
struct hlist_head *init_capa_hash(void);
void cleanup_capa_hash(struct hlist_head *hash);
struct obd_capa *capa_add(struct hlist_head *hash,
struct lustre_capa *capa);
struct obd_capa *capa_lookup(struct hlist_head *hash,
struct lustre_capa *capa, int alive);
int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key);
int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen);
int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen);
void capa_cpy(void *dst, struct obd_capa *ocapa);
static inline struct obd_capa *alloc_capa(int site)
{
struct obd_capa *ocapa;
if (unlikely(site != CAPA_SITE_CLIENT && site != CAPA_SITE_SERVER))
return ERR_PTR(-EINVAL);
OBD_SLAB_ALLOC_PTR(ocapa, capa_cachep);
if (unlikely(!ocapa))
return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&ocapa->c_list);
atomic_set(&ocapa->c_refc, 1);
spin_lock_init(&ocapa->c_lock);
ocapa->c_site = site;
if (ocapa->c_site == CAPA_SITE_CLIENT)
INIT_LIST_HEAD(&ocapa->u.cli.lli_list);
else
INIT_HLIST_NODE(&ocapa->u.tgt.c_hash);
return ocapa;
}
static inline struct obd_capa *capa_get(struct obd_capa *ocapa)
{
if (!ocapa)
return NULL;
atomic_inc(&ocapa->c_refc);
return ocapa;
}
static inline void capa_put(struct obd_capa *ocapa)
{
if (!ocapa)
return;
if (atomic_read(&ocapa->c_refc) == 0) {
DEBUG_CAPA(D_ERROR, &ocapa->c_capa, "refc is 0 for");
LBUG();
}
if (atomic_dec_and_test(&ocapa->c_refc)) {
LASSERT(list_empty(&ocapa->c_list));
if (ocapa->c_site == CAPA_SITE_CLIENT) {
LASSERT(list_empty(&ocapa->u.cli.lli_list));
} else {
struct hlist_node *hnode;
hnode = &ocapa->u.tgt.c_hash;
LASSERT(!hnode->next && !hnode->pprev);
}
OBD_SLAB_FREE(ocapa, capa_cachep, sizeof(*ocapa));
}
}
static inline int open_flags_to_accmode(int flags)
{
int mode = flags;
if ((mode + 1) & O_ACCMODE)
mode++;
if (mode & O_TRUNC)
mode |= 2;
return mode;
}
static inline __u64 capa_open_opc(int mode)
{
return mode & FMODE_WRITE ? CAPA_OPC_OSS_WRITE : CAPA_OPC_OSS_READ;
}
static inline void set_capa_expiry(struct obd_capa *ocapa)
{
unsigned long expiry = cfs_time_sub((unsigned long)ocapa->c_capa.lc_expiry,
get_seconds());
ocapa->c_expiry = cfs_time_add(cfs_time_current(),
cfs_time_seconds(expiry));
}
static inline int capa_is_expired_sec(struct lustre_capa *capa)
{
return (capa->lc_expiry - get_seconds() <= 0);
}
static inline int capa_is_expired(struct obd_capa *ocapa)
{
return time_before_eq(ocapa->c_expiry, cfs_time_current());
}
static inline int capa_opc_supported(struct lustre_capa *capa, __u64 opc)
{
return (capa_opc(capa) & opc) == opc;
}
struct filter_capa_key {
struct list_head k_list;
struct lustre_capa_key k_key;
};
enum {
LC_ID_NONE = 0,
LC_ID_PLAIN = 1,
LC_ID_CONVERT = 2
};
#define BYPASS_CAPA (struct lustre_capa *)ERR_PTR(-ENOENT)
/** @} capa */
#endif /* __LINUX_CAPA_H_ */
......@@ -59,11 +59,6 @@ struct mds_group_info {
int group;
};
struct mds_capa_info {
struct obd_uuid *uuid;
struct lustre_capa_key *capa;
};
#define MDD_OBD_NAME "mdd_obd"
#define MDD_OBD_UUID "mdd_obd_uuid"
......
......@@ -54,7 +54,6 @@
#include "lustre_export.h"
#include "lustre_fid.h"
#include "lustre_fld.h"
#include "lustre_capa.h"
#define MAX_OBD_DEVICES 8192
......@@ -162,9 +161,6 @@ struct obd_info {
* request in osc level for enqueue requests. It is also possible to
* update some caller data from LOV layer if needed. */
obd_enqueue_update_f oi_cb_up;
/* oss capability, its type is obd_capa in client to avoid copy.
* in contrary its type is lustre_capa in OSS. */
void *oi_capa;
};
void lov_stripe_lock(struct lov_stripe_md *md);
......@@ -853,7 +849,6 @@ enum obd_cleanup_stage {
#define KEY_ASYNC "async"
#define KEY_BLOCKSIZE_BITS "blocksize_bits"
#define KEY_BLOCKSIZE "blocksize"
#define KEY_CAPA_KEY "capa_key"
#define KEY_CHANGELOG_CLEAR "changelog_clear"
#define KEY_FID2PATH "fid2path"
#define KEY_CHECKSUM "checksum"
......@@ -956,10 +951,6 @@ struct md_op_data {
__u64 op_ioepoch;
__u32 op_flags;
/* Capa fields */
struct obd_capa *op_capa1;
struct obd_capa *op_capa2;
/* Various operation flags. */
enum mds_op_bias op_bias;
......@@ -1060,14 +1051,12 @@ struct obd_ops {
struct lov_stripe_md **mem_tgt,
struct lov_mds_md *disk_src, int disk_len);
int (*o_preallocate)(struct lustre_handle *, u32 *req, u64 *ids);
/* FIXME: add fid capability support for create & destroy! */
int (*o_create)(const struct lu_env *env, struct obd_export *exp,
struct obdo *oa, struct lov_stripe_md **ea,
struct obd_trans_info *oti);
int (*o_destroy)(const struct lu_env *env, struct obd_export *exp,
struct obdo *oa, struct lov_stripe_md *ea,
struct obd_trans_info *oti, struct obd_export *md_exp,
void *capa);
struct obd_trans_info *oti, struct obd_export *md_exp);
int (*o_setattr)(const struct lu_env *, struct obd_export *exp,
struct obd_info *oinfo, struct obd_trans_info *oti);
int (*o_setattr_async)(struct obd_export *exp, struct obd_info *oinfo,
......@@ -1083,7 +1072,7 @@ struct obd_ops {
struct obd_export *exp, struct obdo *oa, int objcount,
struct obd_ioobj *obj, struct niobuf_remote *remote,
int *nr_pages, struct niobuf_local *local,
struct obd_trans_info *oti, struct lustre_capa *capa);
struct obd_trans_info *oti);
int (*o_commitrw)(const struct lu_env *env, int cmd,
struct obd_export *exp, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
......@@ -1151,8 +1140,6 @@ struct lustre_md {
struct posix_acl *posix_acl;
#endif
struct mdt_remote_perm *remote_perm;
struct obd_capa *mds_capa;
struct obd_capa *oss_capa;
};
struct md_open_data {
......@@ -1166,8 +1153,7 @@ struct md_open_data {
struct lookup_intent;
struct md_ops {
int (*m_getstatus)(struct obd_export *, struct lu_fid *,
struct obd_capa **);
int (*m_getstatus)(struct obd_export *, struct lu_fid *);
int (*m_null_inode)(struct obd_export *, const struct lu_fid *);
int (*m_find_cbdata)(struct obd_export *, const struct lu_fid *,
ldlm_iterator_t, void *);
......@@ -1202,7 +1188,7 @@ struct md_ops {
int, void *, int, struct ptlrpc_request **,
struct md_open_data **mod);
int (*m_sync)(struct obd_export *, const struct lu_fid *,
struct obd_capa *, struct ptlrpc_request **);
struct ptlrpc_request **);
int (*m_readpage)(struct obd_export *, struct md_op_data *,
struct page **, struct ptlrpc_request **);
......@@ -1210,13 +1196,11 @@ struct md_ops {
struct ptlrpc_request **);
int (*m_setxattr)(struct obd_export *, const struct lu_fid *,
struct obd_capa *, u64, const char *,
const char *, int, int, int, __u32,
u64, const char *, const char *, int, int, int, __u32,
struct ptlrpc_request **);
int (*m_getxattr)(struct obd_export *, const struct lu_fid *,
struct obd_capa *, u64, const char *,
const char *, int, int, int,
u64, const char *, const char *, int, int, int,
struct ptlrpc_request **);
int (*m_init_ea_size)(struct obd_export *, int, int, int, int);
......@@ -1242,14 +1226,9 @@ struct md_ops {
int (*m_cancel_unused)(struct obd_export *, const struct lu_fid *,
ldlm_policy_data_t *, ldlm_mode_t,
ldlm_cancel_flags_t flags, void *opaque);
int (*m_renew_capa)(struct obd_export *, struct obd_capa *oc,
renew_capa_cb_t cb);
int (*m_unpack_capa)(struct obd_export *, struct ptlrpc_request *,
const struct req_msg_field *, struct obd_capa **);
int (*m_get_remote_perm)(struct obd_export *, const struct lu_fid *,
struct obd_capa *, __u32,
struct ptlrpc_request **);
__u32, struct ptlrpc_request **);
int (*m_intent_getattr_async)(struct obd_export *,
struct md_enqueue_info *,
......@@ -1298,11 +1277,6 @@ static inline const struct lsm_operations *lsm_op_find(int magic)
#define OBD_CALC_STRIPE_START 1
#define OBD_CALC_STRIPE_END 2
static inline struct lustre_capa *oinfo_capa(struct obd_info *oinfo)
{
return oinfo->oi_capa;
}
static inline struct md_open_data *obd_mod_alloc(void)
{
struct md_open_data *mod;
......
......@@ -760,14 +760,14 @@ static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
struct obdo *obdo, struct lov_stripe_md *ea,
struct obd_trans_info *oti,
struct obd_export *md_exp, void *capa)
struct obd_export *md_exp)
{
int rc;
EXP_CHECK_DT_OP(exp, destroy);
EXP_COUNTER_INCREMENT(exp, destroy);
rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, ea, oti, md_exp, capa);
rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, ea, oti, md_exp);
return rc;
}
......@@ -1168,8 +1168,7 @@ static inline int obd_preprw(const struct lu_env *env, int cmd,
int objcount, struct obd_ioobj *obj,
struct niobuf_remote *remote, int *pages,
struct niobuf_local *local,
struct obd_trans_info *oti,
struct lustre_capa *capa)
struct obd_trans_info *oti)
{
int rc;
......@@ -1177,7 +1176,7 @@ static inline int obd_preprw(const struct lu_env *env, int cmd,
EXP_COUNTER_INCREMENT(exp, preprw);
rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
pages, local, oti, capa);
pages, local, oti);
return rc;
}
......@@ -1425,14 +1424,13 @@ static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp,
#endif
/* metadata helpers */
static inline int md_getstatus(struct obd_export *exp,
struct lu_fid *fid, struct obd_capa **pc)
static inline int md_getstatus(struct obd_export *exp, struct lu_fid *fid)
{
int rc;
EXP_CHECK_MD_OP(exp, getstatus);
EXP_MD_COUNTER_INCREMENT(exp, getstatus);
rc = MDP(exp->exp_obd, getstatus)(exp, fid, pc);
rc = MDP(exp->exp_obd, getstatus)(exp, fid);
return rc;
}
......@@ -1607,13 +1605,13 @@ static inline int md_setattr(struct obd_export *exp, struct md_op_data *op_data,
}
static inline int md_sync(struct obd_export *exp, const struct lu_fid *fid,
struct obd_capa *oc, struct ptlrpc_request **request)
struct ptlrpc_request **request)
{
int rc;
EXP_CHECK_MD_OP(exp, sync);
EXP_MD_COUNTER_INCREMENT(exp, sync);
rc = MDP(exp->exp_obd, sync)(exp, fid, oc, request);
rc = MDP(exp->exp_obd, sync)(exp, fid, request);
return rc;
}
......@@ -1659,8 +1657,7 @@ static inline int md_free_lustre_md(struct obd_export *exp,
return MDP(exp->exp_obd, free_lustre_md)(exp, md);
}
static inline int md_setxattr(struct obd_export *exp,
const struct lu_fid *fid, struct obd_capa *oc,
static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *name,
const char *input, int input_size,
int output_size, int flags, __u32 suppgid,
......@@ -1668,13 +1665,12 @@ static inline int md_setxattr(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, setxattr);
EXP_MD_COUNTER_INCREMENT(exp, setxattr);
return MDP(exp->exp_obd, setxattr)(exp, fid, oc, valid, name, input,
return MDP(exp->exp_obd, setxattr)(exp, fid, valid, name, input,
input_size, output_size, flags,
suppgid, request);
}
static inline int md_getxattr(struct obd_export *exp,
const struct lu_fid *fid, struct obd_capa *oc,
static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *name,
const char *input, int input_size,
int output_size, int flags,
......@@ -1682,7 +1678,7 @@ static inline int md_getxattr(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, getxattr);
EXP_MD_COUNTER_INCREMENT(exp, getxattr);
return MDP(exp->exp_obd, getxattr)(exp, fid, oc, valid, name, input,
return MDP(exp->exp_obd, getxattr)(exp, fid, valid, name, input,
input_size, output_size, flags,
request);
}
......@@ -1753,40 +1749,15 @@ static inline int md_init_ea_size(struct obd_export *exp, int easize,
}
static inline int md_get_remote_perm(struct obd_export *exp,
const struct lu_fid *fid,
struct obd_capa *oc, __u32 suppgid,
const struct lu_fid *fid, __u32 suppgid,
struct ptlrpc_request **request)
{
EXP_CHECK_MD_OP(exp, get_remote_perm);
EXP_MD_COUNTER_INCREMENT(exp, get_remote_perm);
return MDP(exp->exp_obd, get_remote_perm)(exp, fid, oc, suppgid,
return MDP(exp->exp_obd, get_remote_perm)(exp, fid, suppgid,
request);
}
static inline int md_renew_capa(struct obd_export *exp, struct obd_capa *ocapa,
renew_capa_cb_t cb)
{
int rc;
EXP_CHECK_MD_OP(exp, renew_capa);
EXP_MD_COUNTER_INCREMENT(exp, renew_capa);
rc = MDP(exp->exp_obd, renew_capa)(exp, ocapa, cb);
return rc;
}
static inline int md_unpack_capa(struct obd_export *exp,
struct ptlrpc_request *req,
const struct req_msg_field *field,
struct obd_capa **oc)
{
int rc;
EXP_CHECK_MD_OP(exp, unpack_capa);
EXP_MD_COUNTER_INCREMENT(exp, unpack_capa);
rc = MDP(exp->exp_obd, unpack_capa)(exp, req, field, oc);
return rc;
}
static inline int md_intent_getattr_async(struct obd_export *exp,
struct md_enqueue_info *minfo,
struct ldlm_enqueue_info *einfo)
......
......@@ -896,7 +896,6 @@ void ccc_req_completion(const struct lu_env *env,
*
* - o_ioepoch,
*
* and capability.
*/
void ccc_req_attr_set(const struct lu_env *env,
const struct cl_req_slice *slice,
......@@ -911,12 +910,6 @@ void ccc_req_attr_set(const struct lu_env *env,
inode = ccc_object_inode(obj);
valid_flags = OBD_MD_FLTYPE;
if ((flags & OBD_MD_FLOSSCAPA) != 0) {
LASSERT(attr->cra_capa == NULL);
attr->cra_capa = cl_capa_lookup(inode,
slice->crs_req->crq_type);
}
if (slice->crs_req->crq_type == CRT_WRITE) {
if (flags & OBD_MD_FLEPOCH) {
oa->o_valid |= OBD_MD_FLEPOCH;
......@@ -936,8 +929,7 @@ static const struct cl_req_operations ccc_req_ops = {
.cro_completion = ccc_req_completion
};
int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
struct obd_capa *capa)
int cl_setattr_ost(struct inode *inode, const struct iattr *attr)
{
struct lu_env *env;
struct cl_io *io;
......@@ -956,7 +948,6 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
io->u.ci_setattr.sa_attr.lvb_ctime = LTIME_S(attr->ia_ctime);
io->u.ci_setattr.sa_attr.lvb_size = attr->ia_size;
io->u.ci_setattr.sa_valid = attr->ia_valid;
io->u.ci_setattr.sa_capa = capa;
again:
if (cl_io_init(env, io, CIT_SETATTR, io->ci_obj) == 0) {
......
......@@ -2,7 +2,7 @@ obj-$(CONFIG_LUSTRE_FS) += lustre.o
obj-$(CONFIG_LUSTRE_LLITE_LLOOP) += llite_lloop.o
lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \
rw.o namei.o symlink.o llite_mmap.o \
xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o llite_capa.o \
xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o \
rw26.o super25.o statahead.o \
../lclient/glimpse.o ../lclient/lcommon_cl.o ../lclient/lcommon_misc.o \
vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o lproc_llite.o
......
......@@ -92,7 +92,6 @@ void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
op_data->op_ioepoch = ll_i2info(inode)->lli_ioepoch;
if (fh)
op_data->op_handle = *fh;
op_data->op_capa1 = ll_mdscapa_get(inode);
if (ll_i2info(inode)->lli_flags & LLIF_DATA_MODIFIED)
op_data->op_bias |= MDS_DATA_MODIFIED;
......@@ -321,7 +320,6 @@ static int ll_md_close(struct obd_export *md_exp, struct inode *inode,
out:
LUSTRE_FPRIVATE(file) = NULL;
ll_file_data_put(fd);
ll_capa_close(inode);
return rc;
}
......@@ -679,8 +677,6 @@ int ll_file_open(struct inode *inode, struct file *file)
if (!S_ISREG(inode->i_mode))
goto out_och_free;
ll_capa_open(inode);
if (!lli->lli_has_smd &&
(cl_is_lov_delay_create(file->f_flags) ||
(file->f_mode & FMODE_WRITE) == 0)) {
......@@ -912,8 +908,7 @@ static int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
/* Fills the obdo with the attributes for the lsm */
static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
struct obd_capa *capa, struct obdo *obdo,
__u64 ioepoch, int sync)
struct obdo *obdo, __u64 ioepoch, int sync)
{
struct ptlrpc_request_set *set;
struct obd_info oinfo = { };
......@@ -932,7 +927,6 @@ static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
OBD_MD_FLMTIME | OBD_MD_FLCTIME |
OBD_MD_FLGROUP | OBD_MD_FLEPOCH |
OBD_MD_FLDATAVERSION;
oinfo.oi_capa = capa;
if (sync) {
oinfo.oi_oa->o_valid |= OBD_MD_FLFLAGS;
oinfo.oi_oa->o_flags |= OBD_FL_SRVLOCK;
......@@ -963,14 +957,12 @@ static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
int ll_inode_getattr(struct inode *inode, struct obdo *obdo,
__u64 ioepoch, int sync)
{
struct obd_capa *capa = ll_mdscapa_get(inode);
struct lov_stripe_md *lsm;
int rc;
lsm = ccc_inode_lsm_get(inode);
rc = ll_lsm_getattr(lsm, ll_i2dtexp(inode),
capa, obdo, ioepoch, sync);
capa_put(capa);
obdo, ioepoch, sync);
if (rc == 0) {
struct ost_id *oi = lsm ? &lsm->lsm_oi : &obdo->o_oi;
......@@ -1038,7 +1030,7 @@ int ll_glimpse_ioctl(struct ll_sb_info *sbi, struct lov_stripe_md *lsm,
struct obdo obdo = { 0 };
int rc;
rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, NULL, &obdo, 0, 0);
rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, &obdo, 0, 0);
if (rc == 0) {
st->st_size = obdo.o_size;
st->st_blocks = obdo.o_blocks;
......@@ -1874,7 +1866,7 @@ int ll_data_version(struct inode *inode, __u64 *data_version,
goto out;
}
rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, NULL, obdo, 0, extent_lock);
rc = ll_lsm_getattr(lsm, sbi->ll_dt_exp, obdo, 0, extent_lock);
if (rc == 0) {
if (!(obdo->o_valid & OBD_MD_FLDATAVERSION))
rc = -EOPNOTSUPP;
......@@ -2574,7 +2566,6 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
struct cl_env_nest nest;
struct lu_env *env;
struct cl_io *io;
struct obd_capa *capa = NULL;
struct cl_fsync_io *fio;
int result;
......@@ -2586,15 +2577,12 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
if (IS_ERR(env))
return PTR_ERR(env);
capa = ll_osscapa_get(inode, CAPA_OPC_OSS_WRITE);
io = ccc_env_thread_io(env);
io->ci_obj = cl_i2info(inode)->lli_clob;
io->ci_ignore_layout = ignore_layout;
/* initialize parameters for sync */
fio = &io->u.ci_fsync;
fio->fi_capa = capa;
fio->fi_start = start;
fio->fi_end = end;
fio->fi_fid = ll_inode2fid(inode);
......@@ -2610,8 +2598,6 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
cl_io_fini(env, io);
cl_env_nested_put(&nest, env);
capa_put(capa);
return result;
}
......@@ -2620,7 +2606,6 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync)
struct inode *inode = file_inode(file);
struct ll_inode_info *lli = ll_i2info(inode);
struct ptlrpc_request *req;
struct obd_capa *oc;
int rc, err;
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
......@@ -2642,10 +2627,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync)
rc = err;
}
oc = ll_mdscapa_get(inode);
err = md_sync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), oc,
&req);
capa_put(oc);
err = md_sync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), &req);
if (!rc)
rc = err;
if (!err)
......@@ -2963,9 +2945,6 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits)
return PTR_ERR(op_data);
op_data->op_valid = valid;
/* Once OBD_CONNECT_ATTRFID is not supported, we can't find one
* capa for this inode. Because we only keep capas of dirs
* fresh. */
rc = md_getattr(sbi->ll_md_exp, op_data, &req);
ll_finish_md_op_data(op_data);
if (rc) {
......@@ -3316,7 +3295,6 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct obd_capa *oc;
struct ptlrpc_request *req;
struct mdt_body *body;
void *lvbdata;
......@@ -3336,13 +3314,11 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
* blocked and then granted via completion ast, we have to fetch
* layout here. Please note that we can't use the LVB buffer in
* completion AST because it doesn't have a large enough buffer */
oc = ll_mdscapa_get(inode);
rc = ll_get_default_mdsize(sbi, &lmmsize);
if (rc == 0)
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
OBD_MD_FLXATTR, XATTR_NAME_LOV, NULL, 0,
lmmsize, 0, &req);
capa_put(oc);
if (rc < 0)
return rc;
......
This diff is collapsed.
......@@ -134,11 +134,9 @@ struct ll_inode_info {
struct lu_fid lli_pfid;
struct list_head lli_close_list;
struct list_head lli_oss_capas;
/* open count currently used by capability only, indicate whether
* capability needs renewal */
atomic_t lli_open_count;
struct obd_capa *lli_mds_capa;
unsigned long lli_rmtperm_time;
/* handle is to be sent to MDS later on done_writing and setattr.
......@@ -398,8 +396,8 @@ enum stats_track_type {
#define LL_SBI_USER_XATTR 0x08 /* support user xattr */
#define LL_SBI_ACL 0x10 /* support ACL */
#define LL_SBI_RMT_CLIENT 0x40 /* remote client */
#define LL_SBI_MDS_CAPA 0x80 /* support mds capa */
#define LL_SBI_OSS_CAPA 0x100 /* support oss capa */
#define LL_SBI_MDS_CAPA 0x80 /* support mds capa, obsolete */
#define LL_SBI_OSS_CAPA 0x100 /* support oss capa, obsolete */
#define LL_SBI_LOCALFLOCK 0x200 /* Local flocks support by kernel */
#define LL_SBI_LRU_RESIZE 0x400 /* lru resize support */
#define LL_SBI_LAZYSTATFS 0x800 /* lazystatfs mount option */
......@@ -1053,25 +1051,6 @@ void free_rmtperm_hash(struct hlist_head *hash);
int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm);
int lustre_check_remote_perm(struct inode *inode, int mask);
/* llite/llite_capa.c */
extern struct timer_list ll_capa_timer;
int ll_capa_thread_start(void);
void ll_capa_thread_stop(void);
void ll_capa_timer_callback(unsigned long unused);
struct obd_capa *ll_add_capa(struct inode *inode, struct obd_capa *ocapa);
void ll_capa_open(struct inode *inode);
void ll_capa_close(struct inode *inode);
struct obd_capa *ll_mdscapa_get(struct inode *inode);
struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc);
void ll_truncate_free_capa(struct obd_capa *ocapa);
void ll_clear_inode_capas(struct inode *inode);
void ll_print_capa_stat(struct ll_sb_info *sbi);
/* llite/llite_cl.c */
extern struct lu_device_type vvp_device_type;
......@@ -1345,8 +1324,6 @@ static inline int cl_merge_lvb(const struct lu_env *env, struct inode *inode)
#define cl_inode_ctime(inode) LTIME_S((inode)->i_ctime)
#define cl_inode_mtime(inode) LTIME_S((inode)->i_mtime)
struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt);
int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
enum cl_fsync_mode mode, int ignore_layout);
......
......@@ -146,7 +146,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
struct inode *root = NULL;
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct obd_device *obd;
struct obd_capa *oc = NULL;
struct obd_statfs *osfs = NULL;
struct ptlrpc_request *request = NULL;
struct obd_connect_data *data = NULL;
......@@ -182,7 +181,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
data->ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_NODEVOH |
OBD_CONNECT_ATTRFID |
OBD_CONNECT_VERSION | OBD_CONNECT_BRW_SIZE |
OBD_CONNECT_MDS_CAPA | OBD_CONNECT_OSS_CAPA |
OBD_CONNECT_CANCELSET | OBD_CONNECT_FID |
OBD_CONNECT_AT | OBD_CONNECT_LOV_V3 |
OBD_CONNECT_RMT_CLIENT | OBD_CONNECT_VBR |
......@@ -334,16 +332,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
}
}
if (data->ocd_connect_flags & OBD_CONNECT_MDS_CAPA) {
LCONSOLE_INFO("client enabled MDS capability!\n");
sbi->ll_flags |= LL_SBI_MDS_CAPA;
}
if (data->ocd_connect_flags & OBD_CONNECT_OSS_CAPA) {
LCONSOLE_INFO("client enabled OSS capability!\n");
sbi->ll_flags |= LL_SBI_OSS_CAPA;
}
if (data->ocd_connect_flags & OBD_CONNECT_64BITHASH)
sbi->ll_flags |= LL_SBI_64BIT_HASH;
......@@ -445,7 +433,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
mutex_unlock(&sbi->ll_lco.lco_lock);
fid_zero(&sbi->ll_root_fid);
err = md_getstatus(sbi->ll_md_exp, &sbi->ll_root_fid, &oc);
err = md_getstatus(sbi->ll_md_exp, &sbi->ll_root_fid);
if (err) {
CERROR("cannot mds_connect: rc = %d\n", err);
goto out_lock_cn_cb;
......@@ -466,7 +454,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
/* make root inode
* XXX: move this to after cbd setup? */
valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS | OBD_MD_FLMDSCAPA;
valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS;
if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
valid |= OBD_MD_FLRMTPERM;
else if (sbi->ll_flags & LL_SBI_ACL)
......@@ -480,12 +468,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
op_data->op_fid1 = sbi->ll_root_fid;
op_data->op_mode = 0;
op_data->op_capa1 = oc;
op_data->op_valid = valid;
err = md_getattr(sbi->ll_md_exp, op_data, &request);
if (oc)
capa_put(oc);
kfree(op_data);
if (err) {
CERROR("%s: md_getattr failed for root: rc = %d\n",
......@@ -838,9 +823,7 @@ void ll_lli_init(struct ll_inode_info *lli)
/* Do not set lli_fid, it has been initialized already. */
fid_zero(&lli->lli_pfid);
INIT_LIST_HEAD(&lli->lli_close_list);
INIT_LIST_HEAD(&lli->lli_oss_capas);
atomic_set(&lli->lli_open_count, 0);
lli->lli_mds_capa = NULL;
lli->lli_rmtperm_time = 0;
lli->lli_pending_och = NULL;
lli->lli_mds_read_och = NULL;
......@@ -994,8 +977,6 @@ void ll_put_super(struct super_block *sb)
CDEBUG(D_VFSTRACE, "VFS Op: sb %p - %s\n", sb, profilenm);
ll_print_capa_stat(sbi);
cfg.cfg_instance = sb;
lustre_end_log(sb, profilenm, &cfg);
......@@ -1126,7 +1107,6 @@ void ll_clear_inode(struct inode *inode)
#endif
lli->lli_inode_magic = LLI_INODE_DEAD;
ll_clear_inode_capas(inode);
if (!S_ISDIR(inode->i_mode))
LASSERT(list_empty(&lli->lli_agl_list));
......@@ -1183,7 +1163,7 @@ static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
}
ia_valid = op_data->op_attr.ia_valid;
/* inode size will be in ll_setattr_ost, can't do it now since dirty
/* inode size will be in cl_setattr_ost, can't do it now since dirty
* cache is not cleared yet. */
op_data->op_attr.ia_valid &= ~(TIMES_SET_FLAGS | ATTR_SIZE);
rc = simple_setattr(dentry, &op_data->op_attr);
......@@ -1229,27 +1209,6 @@ static int ll_setattr_done_writing(struct inode *inode,
return rc;
}
static int ll_setattr_ost(struct inode *inode, struct iattr *attr)
{
struct obd_capa *capa;
int rc;
if (attr->ia_valid & ATTR_SIZE)
capa = ll_osscapa_get(inode, CAPA_OPC_OSS_TRUNC);
else
capa = ll_mdscapa_get(inode);
rc = cl_setattr_ost(inode, attr, capa);
if (attr->ia_valid & ATTR_SIZE)
ll_truncate_free_capa(capa);
else
capa_put(capa);
return rc;
}
/* If this inode has objects allocated to it (lsm != NULL), then the OST
* object(s) determine the file size and mtime. Otherwise, the MDS will
* keep these values until such a time that objects are allocated for it.
......@@ -1412,7 +1371,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
* time de-synchronization between MDT inode and OST objects */
if (attr->ia_valid & ATTR_SIZE)
down_write(&lli->lli_trunc_sem);
rc = ll_setattr_ost(inode, attr);
rc = cl_setattr_ost(inode, attr);
if (attr->ia_valid & ATTR_SIZE)
up_write(&lli->lli_trunc_sem);
}
......@@ -1705,15 +1664,6 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
inode->i_blocks = body->blocks;
}
if (body->valid & OBD_MD_FLMDSCAPA) {
LASSERT(md->mds_capa);
ll_add_capa(inode, md->mds_capa);
}
if (body->valid & OBD_MD_FLOSSCAPA) {
LASSERT(md->oss_capa);
ll_add_capa(inode, md->oss_capa);
}
if (body->valid & OBD_MD_TSTATE) {
if (body->t_state & MS_RESTORE)
lli->lli_flags |= LLIF_FILE_RESTORING;
......@@ -1862,10 +1812,8 @@ int ll_iocontrol(struct inode *inode, struct file *file,
oinfo.oi_oa->o_flags = flags;
oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS |
OBD_MD_FLGROUP;
oinfo.oi_capa = ll_mdscapa_get(inode);
obdo_set_parent_fid(oinfo.oi_oa, &ll_i2info(inode)->lli_fid);
rc = obd_setattr_rqset(sbi->ll_dt_exp, &oinfo, NULL);
capa_put(oinfo.oi_capa);
OBDO_FREE(oinfo.oi_oa);
ccc_inode_lsm_put(inode, lsm);
......@@ -2205,15 +2153,11 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
ll_i2gids(op_data->op_suppgids, i1, i2);
op_data->op_fid1 = *ll_inode2fid(i1);
op_data->op_capa1 = ll_mdscapa_get(i1);
if (i2) {
if (i2)
op_data->op_fid2 = *ll_inode2fid(i2);
op_data->op_capa2 = ll_mdscapa_get(i2);
} else {
else
fid_zero(&op_data->op_fid2);
op_data->op_capa2 = NULL;
}
op_data->op_name = name;
op_data->op_namelen = namelen;
......@@ -2242,7 +2186,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
if (likely(!lli->lli_has_smd && !fid_is_zero(&lli->lli_pfid)))
op_data->op_fid1 = lli->lli_pfid;
spin_unlock(&lli->lli_lock);
/** We ignore parent's capability temporary. */
}
/* When called by ll_setattr_raw, file is i1. */
......@@ -2254,8 +2197,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
void ll_finish_md_op_data(struct md_op_data *op_data)
{
capa_put(op_data->op_capa1);
capa_put(op_data->op_capa2);
kfree(op_data);
}
......
......@@ -905,7 +905,6 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
struct lov_stripe_md *lsm = NULL;
struct obd_trans_info oti = { 0 };
struct obdo *oa;
struct obd_capa *oc = NULL;
int rc;
/* req is swabbed so this is safe */
......@@ -957,15 +956,8 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
}
}
if (body->valid & OBD_MD_FLOSSCAPA) {
rc = md_unpack_capa(ll_i2mdexp(dir), request, &RMF_CAPA2, &oc);
if (rc)
goto out_free_memmd;
}
rc = obd_destroy(NULL, ll_i2dtexp(dir), oa, lsm, &oti,
ll_i2mdexp(dir), oc);
capa_put(oc);
ll_i2mdexp(dir));
if (rc)
CERROR("obd destroy objid "DOSTID" error %d\n",
POSTID(&lsm->lsm_oi), rc);
......
......@@ -249,7 +249,6 @@ int lustre_check_remote_perm(struct inode *inode, int mask)
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *req = NULL;
struct mdt_remote_perm *perm;
struct obd_capa *oc;
unsigned long save;
int i = 0, rc;
......@@ -276,10 +275,8 @@ int lustre_check_remote_perm(struct inode *inode, int mask)
LBUG();
}
oc = ll_mdscapa_get(inode);
rc = md_get_remote_perm(sbi->ll_md_exp, ll_inode2fid(inode), oc,
rc = md_get_remote_perm(sbi->ll_md_exp, ll_inode2fid(inode),
ll_i2suppgid(inode), &req);
capa_put(oc);
if (rc) {
mutex_unlock(&lli->lli_rmtperm_mutex);
break;
......
......@@ -277,14 +277,6 @@ int ll_commit_write(struct file *file, struct page *vmpage, unsigned from,
return result;
}
struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt)
{
__u64 opc;
opc = crt == CRT_WRITE ? CAPA_OPC_OSS_WRITE : CAPA_OPC_OSS_RW;
return ll_osscapa_get(inode, opc);
}
static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which);
/**
......
......@@ -784,25 +784,16 @@ static void sa_args_fini(struct md_enqueue_info *minfo,
{
LASSERT(minfo && einfo);
iput(minfo->mi_dir);
capa_put(minfo->mi_data.op_capa1);
capa_put(minfo->mi_data.op_capa2);
kfree(minfo);
kfree(einfo);
}
/**
* There is race condition between "capa_put" and "ll_statahead_interpret" for
* accessing "op_data.op_capa[1,2]" as following:
* "capa_put" releases "op_data.op_capa[1,2]"'s reference count after calling
* "md_intent_getattr_async". But "ll_statahead_interpret" maybe run first, and
* fill "op_data.op_capa[1,2]" as POISON, then cause "capa_put" access invalid
* "ocapa". So here reserve "op_data.op_capa[1,2]" in "pcapa" before calling
* "md_intent_getattr_async".
* prepare arguments for async stat RPC.
*/
static int sa_args_init(struct inode *dir, struct inode *child,
struct ll_sa_entry *entry, struct md_enqueue_info **pmi,
struct ldlm_enqueue_info **pei,
struct obd_capa **pcapa)
struct ldlm_enqueue_info **pei)
{
struct qstr *qstr = &entry->se_qstr;
struct ll_inode_info *lli = ll_i2info(dir);
......@@ -843,8 +834,6 @@ static int sa_args_init(struct inode *dir, struct inode *child,
*pmi = minfo;
*pei = einfo;
pcapa[0] = op_data->op_capa1;
pcapa[1] = op_data->op_capa2;
return 0;
}
......@@ -853,20 +842,15 @@ static int do_sa_lookup(struct inode *dir, struct ll_sa_entry *entry)
{
struct md_enqueue_info *minfo;
struct ldlm_enqueue_info *einfo;
struct obd_capa *capas[2];
int rc;
rc = sa_args_init(dir, NULL, entry, &minfo, &einfo, capas);
rc = sa_args_init(dir, NULL, entry, &minfo, &einfo);
if (rc)
return rc;
rc = md_intent_getattr_async(ll_i2mdexp(dir), minfo, einfo);
if (!rc) {
capa_put(capas[0]);
capa_put(capas[1]);
} else {
if (rc < 0)
sa_args_fini(minfo, einfo);
}
return rc;
}
......@@ -885,7 +869,6 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
.d.lustre.it_lock_handle = 0 };
struct md_enqueue_info *minfo;
struct ldlm_enqueue_info *einfo;
struct obd_capa *capas[2];
int rc;
if (unlikely(inode == NULL))
......@@ -903,7 +886,7 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
return 1;
}
rc = sa_args_init(dir, inode, entry, &minfo, &einfo, capas);
rc = sa_args_init(dir, inode, entry, &minfo, &einfo);
if (rc) {
entry->se_inode = NULL;
iput(inode);
......@@ -911,10 +894,7 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
}
rc = md_intent_getattr_async(ll_i2mdexp(dir), minfo, einfo);
if (!rc) {
capa_put(capas[0]);
capa_put(capas[1]);
} else {
if (rc < 0) {
entry->se_inode = NULL;
iput(inode);
sa_args_fini(minfo, einfo);
......
......@@ -154,14 +154,10 @@ static int __init init_lustre_lite(void)
ktime_get_ts64(&ts);
cfs_srand(ts.tv_sec ^ seed[0], ts.tv_nsec ^ seed[1]);
setup_timer(&ll_capa_timer, ll_capa_timer_callback, 0);
rc = ll_capa_thread_start();
if (rc != 0)
goto out_sysfs;
rc = vvp_global_init();
if (rc != 0)
goto out_capa;
goto out_sysfs;
rc = ll_xattr_init();
if (rc != 0)
......@@ -175,9 +171,6 @@ static int __init init_lustre_lite(void)
out_vvp:
vvp_global_fini();
out_capa:
del_timer(&ll_capa_timer);
ll_capa_thread_stop();
out_sysfs:
kset_unregister(llite_kset);
out_debugfs:
......@@ -201,11 +194,6 @@ static void __exit exit_lustre_lite(void)
ll_xattr_fini();
vvp_global_fini();
del_timer(&ll_capa_timer);
ll_capa_thread_stop();
LASSERTF(capa_count[CAPA_SITE_CLIENT] == 0,
"client remaining capa count %d\n",
capa_count[CAPA_SITE_CLIENT]);
kmem_cache_destroy(ll_inode_cachep);
kmem_cache_destroy(ll_rmtperm_hash_cachep);
......
......@@ -111,7 +111,6 @@ int ll_setxattr_common(struct inode *inode, const char *name,
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *req = NULL;
int xattr_type, rc;
struct obd_capa *oc;
#ifdef CONFIG_FS_POSIX_ACL
struct rmtacl_ctl_entry *rce = NULL;
posix_acl_xattr_header *new_value = NULL;
......@@ -189,11 +188,9 @@ int ll_setxattr_common(struct inode *inode, const char *name,
valid |= rce_ops2valid(rce->rce_ops);
}
#endif
oc = ll_mdscapa_get(inode);
rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode),
valid, name, pv, size, 0, flags,
ll_i2suppgid(inode), &req);
capa_put(oc);
#ifdef CONFIG_FS_POSIX_ACL
if (new_value != NULL)
lustre_posix_acl_xattr_free(new_value, size);
......@@ -290,7 +287,6 @@ int ll_getxattr_common(struct inode *inode, const char *name,
struct mdt_body *body;
int xattr_type, rc;
void *xdata;
struct obd_capa *oc;
struct rmtacl_ctl_entry *rce = NULL;
struct ll_inode_info *lli = ll_i2info(inode);
......@@ -381,11 +377,9 @@ int ll_getxattr_common(struct inode *inode, const char *name,
}
} else {
getxattr_nocache:
oc = ll_mdscapa_get(inode);
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
valid | (rce ? rce_ops2valid(rce->rce_ops) : 0),
name, NULL, 0, size, 0, &req);
capa_put(oc);
if (rc < 0)
goto out_xattr;
......
......@@ -1438,8 +1438,7 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
}
static int lmv_getstatus(struct obd_export *exp,
struct lu_fid *fid,
struct obd_capa **pc)
struct lu_fid *fid)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
......@@ -1449,12 +1448,12 @@ static int lmv_getstatus(struct obd_export *exp,
if (rc)
return rc;
rc = md_getstatus(lmv->tgts[0]->ltd_exp, fid, pc);
rc = md_getstatus(lmv->tgts[0]->ltd_exp, fid);
return rc;
}
static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
struct obd_capa *oc, u64 valid, const char *name,
u64 valid, const char *name,
const char *input, int input_size, int output_size,
int flags, struct ptlrpc_request **request)
{
......@@ -1471,14 +1470,14 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
if (IS_ERR(tgt))
return PTR_ERR(tgt);
rc = md_getxattr(tgt->ltd_exp, fid, oc, valid, name, input,
rc = md_getxattr(tgt->ltd_exp, fid, valid, name, input,
input_size, output_size, flags, request);
return rc;
}
static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
struct obd_capa *oc, u64 valid, const char *name,
u64 valid, const char *name,
const char *input, int input_size, int output_size,
int flags, __u32 suppgid,
struct ptlrpc_request **request)
......@@ -1496,7 +1495,7 @@ static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
if (IS_ERR(tgt))
return PTR_ERR(tgt);
rc = md_setxattr(tgt->ltd_exp, fid, oc, valid, name, input,
rc = md_setxattr(tgt->ltd_exp, fid, valid, name, input,
input_size, output_size, flags, suppgid,
request);
......@@ -2014,7 +2013,7 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
}
static int lmv_sync(struct obd_export *exp, const struct lu_fid *fid,
struct obd_capa *oc, struct ptlrpc_request **request)
struct ptlrpc_request **request)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
......@@ -2029,7 +2028,7 @@ static int lmv_sync(struct obd_export *exp, const struct lu_fid *fid,
if (IS_ERR(tgt))
return PTR_ERR(tgt);
rc = md_sync(tgt->ltd_exp, fid, oc, request);
rc = md_sync(tgt->ltd_exp, fid, request);
return rc;
}
......@@ -2607,8 +2606,7 @@ static int lmv_clear_open_replay_data(struct obd_export *exp,
static int lmv_get_remote_perm(struct obd_export *exp,
const struct lu_fid *fid,
struct obd_capa *oc, __u32 suppgid,
struct ptlrpc_request **request)
__u32 suppgid, struct ptlrpc_request **request)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
......@@ -2623,39 +2621,10 @@ static int lmv_get_remote_perm(struct obd_export *exp,
if (IS_ERR(tgt))
return PTR_ERR(tgt);
rc = md_get_remote_perm(tgt->ltd_exp, fid, oc, suppgid, request);
return rc;
}
static int lmv_renew_capa(struct obd_export *exp, struct obd_capa *oc,
renew_capa_cb_t cb)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
struct lmv_tgt_desc *tgt;
int rc;
rc = lmv_check_connect(obd);
if (rc)
return rc;
tgt = lmv_find_target(lmv, &oc->c_capa.lc_fid);
if (IS_ERR(tgt))
return PTR_ERR(tgt);
rc = md_renew_capa(tgt->ltd_exp, oc, cb);
rc = md_get_remote_perm(tgt->ltd_exp, fid, suppgid, request);
return rc;
}
static int lmv_unpack_capa(struct obd_export *exp, struct ptlrpc_request *req,
const struct req_msg_field *field,
struct obd_capa **oc)
{
struct lmv_obd *lmv = &exp->exp_obd->u.lmv;
return md_unpack_capa(lmv->tgts[0]->ltd_exp, req, field, oc);
}
static int lmv_intent_getattr_async(struct obd_export *exp,
struct md_enqueue_info *minfo,
struct ldlm_enqueue_info *einfo)
......@@ -2821,8 +2790,6 @@ static struct md_ops lmv_md_ops = {
.m_free_lustre_md = lmv_free_lustre_md,
.m_set_open_replay_data = lmv_set_open_replay_data,
.m_clear_open_replay_data = lmv_clear_open_replay_data,
.m_renew_capa = lmv_renew_capa,
.m_unpack_capa = lmv_unpack_capa,
.m_get_remote_perm = lmv_get_remote_perm,
.m_intent_getattr_async = lmv_intent_getattr_async,
.m_revalidate_lock = lmv_revalidate_lock
......
......@@ -90,7 +90,6 @@ static void lov_io_sub_inherit(struct cl_io *io, struct lov_io *lio,
case CIT_SETATTR: {
io->u.ci_setattr.sa_attr = parent->u.ci_setattr.sa_attr;
io->u.ci_setattr.sa_valid = parent->u.ci_setattr.sa_valid;
io->u.ci_setattr.sa_capa = parent->u.ci_setattr.sa_capa;
if (cl_io_is_trunc(io)) {
loff_t new_size = parent->u.ci_setattr.sa_attr.lvb_size;
......@@ -111,7 +110,6 @@ static void lov_io_sub_inherit(struct cl_io *io, struct lov_io *lio,
case CIT_FSYNC: {
io->u.ci_fsync.fi_start = start;
io->u.ci_fsync.fi_end = end;
io->u.ci_fsync.fi_capa = parent->u.ci_fsync.fi_capa;
io->u.ci_fsync.fi_fid = parent->u.ci_fsync.fi_fid;
io->u.ci_fsync.fi_mode = parent->u.ci_fsync.fi_mode;
break;
......
......@@ -1061,8 +1061,7 @@ do { \
static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
struct obdo *oa, struct lov_stripe_md *lsm,
struct obd_trans_info *oti, struct obd_export *md_exp,
void *capa)
struct obd_trans_info *oti, struct obd_export *md_exp)
{
struct lov_request_set *set;
struct obd_info oinfo;
......@@ -1094,7 +1093,7 @@ static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
oti->oti_logcookies = set->set_cookies + req->rq_stripe;
err = obd_destroy(env, lov->lov_tgts[req->rq_idx]->ltd_exp,
req->rq_oi.oi_oa, NULL, oti, NULL, capa);
req->rq_oi.oi_oa, NULL, oti, NULL);
err = lov_update_common_set(set, req, err);
if (err) {
CERROR("%s: destroying objid "DOSTID" subobj "
......@@ -2067,7 +2066,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
struct lov_tgt_desc *tgt;
unsigned incr, check_uuid,
do_inactive, no_set;
unsigned next_id = 0, mds_con = 0, capa = 0;
unsigned next_id = 0, mds_con = 0;
incr = check_uuid = do_inactive = no_set = 0;
if (set == NULL) {
......@@ -2092,8 +2091,6 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
/* use defaults: do_inactive = incr = 0; */
} else if (KEY_IS(KEY_MDS_CONN)) {
mds_con = 1;
} else if (KEY_IS(KEY_CAPA_KEY)) {
capa = 1;
} else if (KEY_IS(KEY_CACHE_SET)) {
LASSERT(lov->lov_cache == NULL);
lov->lov_cache = val;
......@@ -2132,19 +2129,6 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
err = obd_set_info_async(env, tgt->ltd_exp,
keylen, key, vallen,
((struct obd_id_info *)val)->data, set);
} else if (capa) {
struct mds_capa_info *info = (struct mds_capa_info *)val;
LASSERT(vallen == sizeof(*info));
/* Only want a specific OSC */
if (info->uuid &&
!obd_uuid_equals(info->uuid, &tgt->ltd_uuid))
continue;
err = obd_set_info_async(env, tgt->ltd_exp, keylen,
key, sizeof(*info->capa),
info->capa, set);
} else {
/* Only want a specific OSC */
if (check_uuid &&
......
......@@ -319,7 +319,6 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_oi = loi->loi_oi;
req->rq_oi.oi_cb_up = cb_getattr_update;
req->rq_oi.oi_capa = oinfo->oi_capa;
lov_set_add_req(req, set);
}
......@@ -518,7 +517,6 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
req->rq_oi.oi_oa->o_oi = loi->loi_oi;
req->rq_oi.oi_oa->o_stripe_idx = i;
req->rq_oi.oi_cb_up = cb_setattr_update;
req->rq_oi.oi_capa = oinfo->oi_capa;
if (oinfo->oi_oa->o_valid & OBD_MD_FLSIZE) {
int off = lov_stripe_offset(oinfo->oi_md,
......
......@@ -43,17 +43,14 @@
void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
struct obd_capa *oc, __u64 valid, int ea_size,
__u32 suppgid, int flags);
void mdc_pack_capa(struct ptlrpc_request *req,
const struct req_msg_field *field, struct obd_capa *oc);
__u64 valid, int ea_size, __u32 suppgid, int flags);
int mdc_pack_req(struct ptlrpc_request *req, int version, int opc);
void mdc_is_subdir_pack(struct ptlrpc_request *req, const struct lu_fid *pfid,
const struct lu_fid *cfid, int flags);
void mdc_swap_layouts_pack(struct ptlrpc_request *req,
struct md_op_data *op_data);
void mdc_readdir_pack(struct ptlrpc_request *req, __u64 pgoff, __u32 size,
const struct lu_fid *fid, struct obd_capa *oc);
const struct lu_fid *fid);
void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, int flags,
struct md_op_data *data, int ea_size);
void mdc_setattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
......@@ -140,17 +137,6 @@ int mdc_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
ldlm_policy_data_t *policy, ldlm_mode_t mode,
ldlm_cancel_flags_t flags, void *opaque);
static inline void mdc_set_capa_size(struct ptlrpc_request *req,
const struct req_msg_field *field,
struct obd_capa *oc)
{
if (oc == NULL)
req_capsule_set_size(&req->rq_pill, field, RCL_CLIENT, 0);
else
/* it is already calculated as sizeof struct obd_capa */
;
}
int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
struct lu_fid *fid, __u64 *bits);
......
......@@ -52,24 +52,6 @@ static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
b->capability = cfs_curproc_cap_pack();
}
void mdc_pack_capa(struct ptlrpc_request *req,
const struct req_msg_field *field,
struct obd_capa *oc)
{
struct req_capsule *pill = &req->rq_pill;
struct lustre_capa *c;
if (oc == NULL) {
LASSERT(req_capsule_get_size(pill, field, RCL_CLIENT) == 0);
return;
}
c = req_capsule_client_get(pill, field);
LASSERT(c != NULL);
capa_cpy(c, oc);
DEBUG_CAPA(D_SEC, c, "pack");
}
void mdc_is_subdir_pack(struct ptlrpc_request *req, const struct lu_fid *pfid,
const struct lu_fid *cfid, int flags)
{
......@@ -95,13 +77,9 @@ void mdc_swap_layouts_pack(struct ptlrpc_request *req,
b->fid1 = op_data->op_fid1;
b->fid2 = op_data->op_fid2;
b->valid |= OBD_MD_FLID;
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
mdc_pack_capa(req, &RMF_CAPA2, op_data->op_capa2);
}
void mdc_pack_body(struct ptlrpc_request *req,
const struct lu_fid *fid, struct obd_capa *oc,
void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
__u64 valid, int ea_size, __u32 suppgid, int flags)
{
struct mdt_body *b = req_capsule_client_get(&req->rq_pill,
......@@ -114,12 +92,11 @@ void mdc_pack_body(struct ptlrpc_request *req,
if (fid) {
b->fid1 = *fid;
b->valid |= OBD_MD_FLID;
mdc_pack_capa(req, &RMF_CAPA1, oc);
}
}
void mdc_readdir_pack(struct ptlrpc_request *req, __u64 pgoff,
__u32 size, const struct lu_fid *fid, struct obd_capa *oc)
__u32 size, const struct lu_fid *fid)
{
struct mdt_body *b = req_capsule_client_get(&req->rq_pill,
&RMF_MDT_BODY);
......@@ -129,8 +106,6 @@ void mdc_readdir_pack(struct ptlrpc_request *req, __u64 pgoff,
b->nlink = size; /* !! */
__mdc_pack_body(b, -1);
b->mode = LUDA_FID | LUDA_TYPE;
mdc_pack_capa(req, &RMF_CAPA1, oc);
}
/* packing of MDS records */
......@@ -164,8 +139,6 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
rec->cr_bias = op_data->op_bias;
rec->cr_umask = current_umask();
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
LOGL0(op_data->op_name, op_data->op_namelen, tmp);
......@@ -235,10 +208,6 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
rec->cr_umask = current_umask();
rec->cr_old_handle = op_data->op_handle;
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
/* the next buffer is child capa, which is used for replay,
* will be packed from the data in reply message. */
if (op_data->op_name) {
tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
LOGL0(op_data->op_name, op_data->op_namelen, tmp);
......@@ -347,8 +316,6 @@ void mdc_setattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
mdc_setattr_pack_rec(rec, op_data);
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
if (op_data->op_flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) {
epoch = req_capsule_client_get(&req->rq_pill, &RMF_MDT_EPOCH);
mdc_ioepoch_pack(epoch, op_data);
......@@ -396,8 +363,6 @@ void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
rec->ul_time = op_data->op_mod_time;
rec->ul_bias = op_data->op_bias;
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
LASSERT(tmp != NULL);
LOGL0(op_data->op_name, op_data->op_namelen, tmp);
......@@ -423,9 +388,6 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
rec->lk_time = op_data->op_mod_time;
rec->lk_bias = op_data->op_bias;
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
mdc_pack_capa(req, &RMF_CAPA2, op_data->op_capa2);
tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
LOGL0(op_data->op_name, op_data->op_namelen, tmp);
}
......@@ -452,9 +414,6 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
rec->rn_mode = op_data->op_mode;
rec->rn_bias = op_data->op_bias;
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
mdc_pack_capa(req, &RMF_CAPA2, op_data->op_capa2);
tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
LOGL0(old, oldlen, tmp);
......@@ -483,8 +442,6 @@ void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, int flags,
b->fid2 = op_data->op_fid2;
b->valid |= OBD_MD_FLID;
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
if (op_data->op_name) {
char *tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
......@@ -524,7 +481,6 @@ void mdc_close_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
mdc_setattr_pack_rec(rec, op_data);
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
mdc_ioepoch_pack(epoch, op_data);
mdc_hsm_release_pack(req, op_data);
}
......
......@@ -322,12 +322,6 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
return ERR_PTR(-ENOMEM);
}
/* parent capability */
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
/* child capability, reserve the size according to parent capa, it will
* be filled after we get the reply */
mdc_set_capa_size(req, &RMF_CAPA2, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT,
......@@ -376,8 +370,6 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
if (req == NULL)
return ERR_PTR(-ENOMEM);
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ldlm_prep_enqueue_req(exp, req, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
......@@ -391,8 +383,8 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
maxdata = class_exp2cliimp(exp)->imp_connect_data.ocd_max_easize;
/* pack the intended request */
mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
op_data->op_valid, maxdata, -1, 0);
mdc_pack_body(req, &op_data->op_fid1, op_data->op_valid, maxdata, -1,
0);
req_capsule_set_size(&req->rq_pill, &RMF_EADATA,
RCL_SERVER, maxdata);
......@@ -422,7 +414,6 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
if (req == NULL)
return ERR_PTR(-ENOMEM);
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
......@@ -455,7 +446,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
struct obd_device *obddev = class_exp2obd(exp);
u64 valid = OBD_MD_FLGETATTR | OBD_MD_FLEASIZE |
OBD_MD_FLMODEASIZE | OBD_MD_FLDIREA |
OBD_MD_FLMDSCAPA | OBD_MD_MEA |
OBD_MD_MEA |
(client_is_remote(exp) ?
OBD_MD_FLRMTPERM : OBD_MD_FLACL);
struct ldlm_intent *lit;
......@@ -467,7 +458,6 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
if (req == NULL)
return ERR_PTR(-ENOMEM);
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
......@@ -705,27 +695,6 @@ static int mdc_finish_enqueue(struct obd_export *exp,
if (perm == NULL)
return -EPROTO;
}
if (body->valid & OBD_MD_FLMDSCAPA) {
struct lustre_capa *capa, *p;
capa = req_capsule_server_get(pill, &RMF_CAPA1);
if (capa == NULL)
return -EPROTO;
if (it->it_op & IT_OPEN) {
/* client fid capa will be checked in replay */
p = req_capsule_client_get(pill, &RMF_CAPA2);
LASSERT(p);
*p = *capa;
}
}
if (body->valid & OBD_MD_FLOSSCAPA) {
struct lustre_capa *capa;
capa = req_capsule_server_get(pill, &RMF_CAPA2);
if (capa == NULL)
return -EPROTO;
}
} else if (it->it_op & IT_LAYOUT) {
/* maybe the lock was granted right away and layout
* is packed into RMF_DLM_LVB of req */
......
......@@ -127,7 +127,6 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
ldlm_lock_list_put(&cancels, l_bl_ast, count);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
if ((op_data->op_flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) == 0)
req_capsule_set_size(&req->rq_pill, &RMF_MDT_EPOCH, RCL_CLIENT,
0);
......@@ -242,7 +241,6 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
ldlm_lock_list_put(&cancels, l_bl_ast, count);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT,
......@@ -296,18 +294,6 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
CDEBUG(D_HA, "resend cross eviction\n");
return -EIO;
}
} else if (rc == 0) {
struct mdt_body *body;
struct lustre_capa *capa;
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
LASSERT(body);
if (body->valid & OBD_MD_FLMDSCAPA) {
capa = req_capsule_server_get(&req->rq_pill,
&RMF_CAPA1);
if (capa == NULL)
rc = -EPROTO;
}
}
*request = req;
......@@ -342,7 +328,6 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
ldlm_lock_list_put(&cancels, l_bl_ast, count);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
......@@ -392,8 +377,6 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
ldlm_lock_list_put(&cancels, l_bl_ast, count);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
mdc_set_capa_size(req, &RMF_CAPA2, op_data->op_capa2);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
......@@ -451,8 +434,6 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
mdc_set_capa_size(req, &RMF_CAPA2, op_data->op_capa2);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT, oldlen + 1);
req_capsule_set_size(&req->rq_pill, &RMF_SYMTGT, RCL_CLIENT, newlen+1);
......
......@@ -5,5 +5,5 @@ obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
genops.o uuid.o lprocfs_status.o \
lustre_handles.o lustre_peer.o \
statfs_pack.o obdo.o obd_config.o obd_mount.o \
lu_object.o capa.o cl_object.o \
lu_object.o cl_object.o \
cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o lprocfs_counters.o
This diff is collapsed.
......@@ -479,9 +479,6 @@ static int __init init_obdclass(void)
int i, err;
int lustre_register_fs(void);
for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
INIT_LIST_HEAD(&capa_list[i]);
LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
spin_lock_init(&obd_types_lock);
......
......@@ -645,8 +645,6 @@ void obd_cleanup_caches(void)
obdo_cachep = NULL;
kmem_cache_destroy(import_cachep);
import_cachep = NULL;
kmem_cache_destroy(capa_cachep);
capa_cachep = NULL;
}
int obd_init_caches(void)
......@@ -671,12 +669,6 @@ int obd_init_caches(void)
if (!import_cachep)
goto out;
LASSERT(!capa_cachep);
capa_cachep = kmem_cache_create("capa_cache",
sizeof(struct obd_capa), 0, 0, NULL);
if (!capa_cachep)
goto out;
return 0;
out:
obd_cleanup_caches();
......
......@@ -1400,7 +1400,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
failed:
if (created && rc)
obd_destroy(env, ec->ec_exp, oa, lsm, oti, NULL, NULL);
obd_destroy(env, ec->ec_exp, oa, lsm, oti, NULL);
if (lsm)
echo_free_memmd(ed, &lsm);
if (rc)
......@@ -1691,7 +1691,7 @@ static int echo_client_prep_commit(const struct lu_env *env,
lpages = npages;
ret = obd_preprw(env, rw, exp, oa, 1, &ioo, rnb, &lpages,
lnb, oti, NULL);
lnb, oti);
if (ret != 0)
goto out;
LASSERT(lpages == npages);
......@@ -1907,7 +1907,7 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
rc = echo_get_object(&eco, ed, oa);
if (rc == 0) {
rc = obd_destroy(env, ec->ec_exp, oa, eco->eo_lsm,
&dummy_oti, NULL, NULL);
&dummy_oti, NULL);
if (rc == 0)
eco->eo_deleted = 1;
echo_put_object(eco);
......
......@@ -457,7 +457,6 @@ static int osc_io_setattr_start(const struct lu_env *env,
}
oinfo.oi_oa = oa;
oinfo.oi_capa = io->u.ci_setattr.sa_capa;
init_completion(&cbargs->opc_sync);
if (ia_valid & ATTR_SIZE)
......@@ -564,7 +563,6 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
memset(oinfo, 0, sizeof(*oinfo));
oinfo->oi_oa = oa;
oinfo->oi_capa = fio->fi_capa;
init_completion(&cbargs->opc_sync);
rc = osc_sync_base(osc_export(obj), oinfo, osc_async_upcall, cbargs,
......
......@@ -72,7 +72,6 @@ struct osc_brw_async_args {
struct client_obd *aa_cli;
struct list_head aa_oaps;
struct list_head aa_exts;
struct obd_capa *aa_ocapa;
struct cl_req *aa_clerq;
};
......@@ -200,22 +199,6 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
return lsm_size;
}
static inline void osc_pack_capa(struct ptlrpc_request *req,
struct ost_body *body, void *capa)
{
struct obd_capa *oc = (struct obd_capa *)capa;
struct lustre_capa *c;
if (!capa)
return;
c = req_capsule_client_get(&req->rq_pill, &RMF_CAPA1);
LASSERT(c);
capa_cpy(c, oc);
body->oa.o_valid |= OBD_MD_FLOSSCAPA;
DEBUG_CAPA(D_SEC, c, "pack");
}
static inline void osc_pack_req_body(struct ptlrpc_request *req,
struct obd_info *oinfo)
{
......@@ -226,18 +209,6 @@ static inline void osc_pack_req_body(struct ptlrpc_request *req,
lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
oinfo->oi_oa);
osc_pack_capa(req, body, oinfo->oi_capa);
}
static inline void osc_set_capa_size(struct ptlrpc_request *req,
const struct req_msg_field *field,
struct obd_capa *oc)
{
if (oc == NULL)
req_capsule_set_size(&req->rq_pill, field, RCL_CLIENT, 0);
else
/* it is already calculated as sizeof struct obd_capa */
;
}
static int osc_getattr_interpret(const struct lu_env *env,
......@@ -279,7 +250,6 @@ static int osc_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
if (req == NULL)
return -ENOMEM;
osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GETATTR);
if (rc) {
ptlrpc_request_free(req);
......@@ -310,7 +280,6 @@ static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
if (req == NULL)
return -ENOMEM;
osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GETATTR);
if (rc) {
ptlrpc_request_free(req);
......@@ -356,7 +325,6 @@ static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
if (req == NULL)
return -ENOMEM;
osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SETATTR);
if (rc) {
ptlrpc_request_free(req);
......@@ -420,7 +388,6 @@ int osc_setattr_async_base(struct obd_export *exp, struct obd_info *oinfo,
if (req == NULL)
return -ENOMEM;
osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SETATTR);
if (rc) {
ptlrpc_request_free(req);
......@@ -566,7 +533,6 @@ int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
if (req == NULL)
return -ENOMEM;
osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_PUNCH);
if (rc) {
ptlrpc_request_free(req);
......@@ -579,7 +545,6 @@ int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
LASSERT(body);
lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
oinfo->oi_oa);
osc_pack_capa(req, body, oinfo->oi_capa);
ptlrpc_request_set_replen(req);
......@@ -633,7 +598,6 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
if (req == NULL)
return -ENOMEM;
osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SYNC);
if (rc) {
ptlrpc_request_free(req);
......@@ -645,7 +609,6 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
LASSERT(body);
lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
oinfo->oi_oa);
osc_pack_capa(req, body, oinfo->oi_capa);
ptlrpc_request_set_replen(req);
req->rq_interpret_reply = osc_sync_interpret;
......@@ -763,8 +726,7 @@ int osc_create(const struct lu_env *env, struct obd_export *exp,
* cookies to the MDS after committing destroy transactions. */
static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
struct obdo *oa, struct lov_stripe_md *ea,
struct obd_trans_info *oti, struct obd_export *md_export,
void *capa)
struct obd_trans_info *oti, struct obd_export *md_export)
{
struct client_obd *cli = &exp->exp_obd->u.cli;
struct ptlrpc_request *req;
......@@ -786,7 +748,6 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
return -ENOMEM;
}
osc_set_capa_size(req, &RMF_CAPA1, (struct obd_capa *)capa);
rc = ldlm_prep_elc_req(exp, req, LUSTRE_OST_VERSION, OST_DESTROY,
0, &cancels, count);
if (rc) {
......@@ -803,7 +764,6 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
LASSERT(body);
lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
osc_pack_capa(req, body, (struct obd_capa *)capa);
ptlrpc_request_set_replen(req);
/* If osc_destroy is for destroying the unlink orphan,
......@@ -1256,7 +1216,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
struct lov_stripe_md *lsm, u32 page_count,
struct brw_page **pga,
struct ptlrpc_request **reqp,
struct obd_capa *ocapa, int reserve,
int reserve,
int resend)
{
struct ptlrpc_request *req;
......@@ -1296,7 +1256,6 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
sizeof(*ioobj));
req_capsule_set_size(pill, &RMF_NIOBUF_REMOTE, RCL_CLIENT,
niocount * sizeof(*niobuf));
osc_set_capa_size(req, &RMF_CAPA1, ocapa);
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, opc);
if (rc) {
......@@ -1335,7 +1294,6 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
* "max - 1" for old client compatibility sending "0", and also so the
* the actual maximum is a power-of-two number, not one less. LU-1431 */
ioobj_max_brw_set(ioobj, desc->bd_md_max_brw);
osc_pack_capa(req, body, ocapa);
LASSERT(page_count > 0);
pg_prev = pga[0];
for (requested_nob = i = 0; i < page_count; i++, niobuf++) {
......@@ -1444,8 +1402,6 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
aa->aa_ppga = pga;
aa->aa_cli = cli;
INIT_LIST_HEAD(&aa->aa_oaps);
if (ocapa && reserve)
aa->aa_ocapa = capa_get(ocapa);
*reqp = req;
return 0;
......@@ -1667,7 +1623,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
aa->aa_cli, aa->aa_oa,
NULL /* lsm unused by osc currently */,
aa->aa_page_count, aa->aa_ppga,
&new_req, aa->aa_ocapa, 0, 1);
&new_req, 0, 1);
if (rc)
return rc;
......@@ -1711,9 +1667,6 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
}
}
new_aa->aa_ocapa = aa->aa_ocapa;
aa->aa_ocapa = NULL;
/* XXX: This code will run into problem if we're going to support
* to add a series of BRW RPCs into a self-defined ptlrpc_request_set
* and wait for all of them to be finished. We should inherit request
......@@ -1795,11 +1748,6 @@ static int brw_interpret(const struct lu_env *env,
rc = -EIO;
}
if (aa->aa_ocapa) {
capa_put(aa->aa_ocapa);
aa->aa_ocapa = NULL;
}
list_for_each_entry_safe(ext, tmp, &aa->aa_exts, oe_link) {
if (obj == NULL && rc == 0) {
obj = osc2cl(ext->oe_obj);
......@@ -1975,7 +1923,7 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
sort_brw_pages(pga, page_count);
rc = osc_brw_prep_request(cmd, cli, oa, NULL, page_count,
pga, &req, crattr->cra_capa, 1, 0);
pga, &req, 1, 0);
if (rc != 0) {
CERROR("prep_req failed: %d\n", rc);
goto out;
......@@ -2051,7 +1999,6 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
cfs_memory_pressure_restore(mpflag);
if (crattr != NULL) {
capa_put(crattr->cra_capa);
kfree(crattr);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment