diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/include/obd_class.h')
-rw-r--r-- | drivers/staging/lustre/lustre/include/obd_class.h | 195 |
1 files changed, 83 insertions, 112 deletions
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 6482a937000b..16094dbec08b 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -56,7 +56,6 @@ #define OBD_STATFS_FOR_MDT0 0x0008 /* The statfs is only for retrieving * information from MDT0. */ -#define OBD_FL_PUNCH 0x00000001 /* To indicate it is punch operation */ /* OBD Device Declarations */ extern struct obd_device *obd_devs[MAX_OBD_DEVICES]; @@ -97,6 +96,11 @@ int obd_zombie_impexp_init(void); void obd_zombie_impexp_stop(void); void obd_zombie_barrier(void); +int obd_get_request_slot(struct client_obd *cli); +void obd_put_request_slot(struct client_obd *cli); +__u32 obd_get_max_rpcs_in_flight(struct client_obd *cli); +int obd_set_max_rpcs_in_flight(struct client_obd *cli, __u32 max); + struct llog_handle; struct llog_rec_hdr; typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *, @@ -265,10 +269,10 @@ static inline int lprocfs_climp_check(struct obd_device *obd) struct inode; struct lu_attr; struct obdo; -void obdo_refresh_inode(struct inode *dst, struct obdo *src, u32 valid); +void obdo_refresh_inode(struct inode *dst, const struct obdo *src, u32 valid); -void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj); -void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, u32 valid); +void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj); +void md_from_obdo(struct md_op_data *op_data, const struct obdo *oa, u32 valid); #define OBT(dev) (dev)->obd_type #define OBP(dev, op) (dev)->obd_type->typ_dt_ops->op @@ -673,15 +677,6 @@ static inline int obd_unpackmd(struct obd_export *exp, return rc; } -/* helper functions */ -static inline int obd_alloc_memmd(struct obd_export *exp, - struct lov_stripe_md **mem_tgt) -{ - LASSERT(mem_tgt); - LASSERT(!*mem_tgt); - return obd_unpackmd(exp, mem_tgt, NULL, 0); -} - static inline int obd_free_memmd(struct obd_export *exp, struct lov_stripe_md **mem_tgt) { @@ -695,29 +690,26 @@ static inline int obd_free_memmd(struct obd_export *exp, } static inline int obd_create(const struct lu_env *env, struct obd_export *exp, - struct obdo *obdo, struct lov_stripe_md **ea, - struct obd_trans_info *oti) + struct obdo *obdo, struct obd_trans_info *oti) { int rc; EXP_CHECK_DT_OP(exp, create); EXP_COUNTER_INCREMENT(exp, create); - rc = OBP(exp->exp_obd, create)(env, exp, obdo, ea, oti); + rc = OBP(exp->exp_obd, create)(env, exp, obdo, oti); return rc; } 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) + struct obdo *obdo, struct obd_trans_info *oti) { 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); + rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, oti); return rc; } @@ -925,7 +917,8 @@ static inline int obd_fid_fini(struct obd_device *obd) return rc; } -static inline int obd_fid_alloc(struct obd_export *exp, +static inline int obd_fid_alloc(const struct lu_env *env, + struct obd_export *exp, struct lu_fid *fid, struct md_op_data *op_data) { @@ -934,7 +927,7 @@ static inline int obd_fid_alloc(struct obd_export *exp, EXP_CHECK_DT_OP(exp, fid_alloc); EXP_COUNTER_INCREMENT(exp, fid_alloc); - rc = OBP(exp->exp_obd, fid_alloc)(exp, fid, op_data); + rc = OBP(exp->exp_obd, fid_alloc)(env, exp, fid, op_data); return rc; } @@ -1147,19 +1140,6 @@ static inline int obd_commitrw(const struct lu_env *env, int cmd, return rc; } -static inline int obd_adjust_kms(struct obd_export *exp, - struct lov_stripe_md *lsm, u64 size, - int shrink) -{ - int rc; - - EXP_CHECK_DT_OP(exp, adjust_kms); - EXP_COUNTER_INCREMENT(exp, adjust_kms); - - rc = OBP(exp->exp_obd, adjust_kms)(exp, lsm, size, shrink); - return rc; -} - static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp, int len, void *karg, void __user *uarg) { @@ -1172,19 +1152,6 @@ static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp, return rc; } -static inline int obd_find_cbdata(struct obd_export *exp, - struct lov_stripe_md *lsm, - ldlm_iterator_t it, void *data) -{ - int rc; - - EXP_CHECK_DT_OP(exp, find_cbdata); - EXP_COUNTER_INCREMENT(exp, find_cbdata); - - rc = OBP(exp->exp_obd, find_cbdata)(exp, lsm, it, data); - return rc; -} - static inline void obd_import_event(struct obd_device *obd, struct obd_import *imp, enum obd_import_event event) @@ -1210,12 +1177,7 @@ static inline int obd_notify(struct obd_device *obd, if (rc) return rc; - /* the check for async_recov is a complete hack - I'm hereby - * overloading the meaning to also mean "this was called from - * mds_postsetup". I know that my mds is able to handle notifies - * by this point, and it needs to get them to execute mds_postrecov. - */ - if (!obd->obd_set_up && !obd->obd_async_recov) { + if (!obd->obd_set_up) { CDEBUG(D_HA, "obd %s not set up\n", obd->obd_name); return -EINVAL; } @@ -1358,18 +1320,6 @@ static inline int md_null_inode(struct obd_export *exp, return rc; } -static inline int md_find_cbdata(struct obd_export *exp, - const struct lu_fid *fid, - ldlm_iterator_t it, void *data) -{ - int rc; - - EXP_CHECK_MD_OP(exp, find_cbdata); - EXP_MD_COUNTER_INCREMENT(exp, find_cbdata); - rc = MDP(exp->exp_obd, find_cbdata)(exp, fid, it, data); - return rc; -} - static inline int md_close(struct obd_export *exp, struct md_op_data *op_data, struct md_open_data *mod, struct ptlrpc_request **request) @@ -1383,9 +1333,9 @@ static inline int md_close(struct obd_export *exp, struct md_op_data *op_data, } static inline int md_create(struct obd_export *exp, struct md_op_data *op_data, - const void *data, int datalen, int mode, __u32 uid, - __u32 gid, cfs_cap_t cap_effective, __u64 rdev, - struct ptlrpc_request **request) + const void *data, size_t datalen, umode_t mode, + uid_t uid, gid_t gid, cfs_cap_t cap_effective, + __u64 rdev, struct ptlrpc_request **request) { int rc; @@ -1410,19 +1360,18 @@ static inline int md_done_writing(struct obd_export *exp, static inline int md_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo, + const ldlm_policy_data_t *policy, struct lookup_intent *it, struct md_op_data *op_data, struct lustre_handle *lockh, - void *lmm, int lmmsize, - struct ptlrpc_request **req, __u64 extra_lock_flags) { int rc; EXP_CHECK_MD_OP(exp, enqueue); EXP_MD_COUNTER_INCREMENT(exp, enqueue); - rc = MDP(exp->exp_obd, enqueue)(exp, einfo, it, op_data, lockh, - lmm, lmmsize, req, extra_lock_flags); + rc = MDP(exp->exp_obd, enqueue)(exp, einfo, policy, it, op_data, lockh, + extra_lock_flags); return rc; } @@ -1439,9 +1388,9 @@ static inline int md_getattr_name(struct obd_export *exp, } static inline int md_intent_lock(struct obd_export *exp, - struct md_op_data *op_data, void *lmm, - int lmmsize, struct lookup_intent *it, - int lookup_flags, struct ptlrpc_request **reqp, + struct md_op_data *op_data, + struct lookup_intent *it, + struct ptlrpc_request **reqp, ldlm_blocking_callback cb_blocking, __u64 extra_lock_flags) { @@ -1449,9 +1398,8 @@ static inline int md_intent_lock(struct obd_export *exp, EXP_CHECK_MD_OP(exp, intent_lock); EXP_MD_COUNTER_INCREMENT(exp, intent_lock); - rc = MDP(exp->exp_obd, intent_lock)(exp, op_data, lmm, lmmsize, - it, lookup_flags, reqp, cb_blocking, - extra_lock_flags); + rc = MDP(exp->exp_obd, intent_lock)(exp, op_data, it, reqp, + cb_blocking, extra_lock_flags); return rc; } @@ -1467,8 +1415,8 @@ static inline int md_link(struct obd_export *exp, struct md_op_data *op_data, } static inline int md_rename(struct obd_export *exp, struct md_op_data *op_data, - const char *old, int oldlen, const char *new, - int newlen, struct ptlrpc_request **request) + const char *old, size_t oldlen, const char *new, + size_t newlen, struct ptlrpc_request **request) { int rc; @@ -1479,21 +1427,8 @@ static inline int md_rename(struct obd_export *exp, struct md_op_data *op_data, return rc; } -static inline int md_is_subdir(struct obd_export *exp, - const struct lu_fid *pfid, - const struct lu_fid *cfid, - struct ptlrpc_request **request) -{ - int rc; - - EXP_CHECK_MD_OP(exp, is_subdir); - EXP_MD_COUNTER_INCREMENT(exp, is_subdir); - rc = MDP(exp->exp_obd, is_subdir)(exp, pfid, cfid, request); - return rc; -} - static inline int md_setattr(struct obd_export *exp, struct md_op_data *op_data, - void *ea, int ealen, void *ea2, int ea2len, + void *ea, size_t ealen, void *ea2, size_t ea2len, struct ptlrpc_request **request, struct md_open_data **mod) { @@ -1517,15 +1452,18 @@ static inline int md_sync(struct obd_export *exp, const struct lu_fid *fid, return rc; } -static inline int md_readpage(struct obd_export *exp, struct md_op_data *opdata, - struct page **pages, - struct ptlrpc_request **request) +static inline int md_read_page(struct obd_export *exp, + struct md_op_data *op_data, + struct md_callback *cb_op, + __u64 hash_offset, + struct page **ppage) { int rc; - EXP_CHECK_MD_OP(exp, readpage); - EXP_MD_COUNTER_INCREMENT(exp, readpage); - rc = MDP(exp->exp_obd, readpage)(exp, opdata, pages, request); + EXP_CHECK_MD_OP(exp, read_page); + EXP_MD_COUNTER_INCREMENT(exp, read_page); + rc = MDP(exp->exp_obd, read_page)(exp, op_data, cb_op, hash_offset, + ppage); return rc; } @@ -1559,6 +1497,16 @@ 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_merge_attr(struct obd_export *exp, + const struct lmv_stripe_md *lsm, + struct cl_attr *attr, + ldlm_blocking_callback cb) +{ + EXP_CHECK_MD_OP(exp, merge_attr); + EXP_MD_COUNTER_INCREMENT(exp, merge_attr); + return MDP(exp->exp_obd, merge_attr)(exp, lsm, attr, cb); +} + 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, @@ -1603,7 +1551,8 @@ static inline int md_clear_open_replay_data(struct obd_export *exp, } static inline int md_set_lock_data(struct obd_export *exp, - __u64 *lockh, void *data, __u64 *bits) + const struct lustre_handle *lockh, + void *data, __u64 *bits) { EXP_CHECK_MD_OP(exp, set_lock_data); EXP_MD_COUNTER_INCREMENT(exp, set_lock_data); @@ -1674,6 +1623,19 @@ static inline int md_revalidate_lock(struct obd_export *exp, return rc; } +static inline int md_get_fid_from_lsm(struct obd_export *exp, + const struct lmv_stripe_md *lsm, + const char *name, int namelen, + struct lu_fid *fid) +{ + int rc; + + EXP_CHECK_MD_OP(exp, get_fid_from_lsm); + EXP_MD_COUNTER_INCREMENT(exp, get_fid_from_lsm); + rc = MDP(exp->exp_obd, get_fid_from_lsm)(exp, lsm, name, namelen, fid); + return rc; +} + /* OBD Metadata Support */ int obd_init_caches(void); @@ -1682,16 +1644,6 @@ void obd_cleanup_caches(void); /* support routines */ extern struct kmem_cache *obdo_cachep; -static inline void obdo2fid(struct obdo *oa, struct lu_fid *fid) -{ - /* something here */ -} - -static inline void fid2obdo(struct lu_fid *fid, struct obdo *oa) -{ - /* something here */ -} - typedef int (*register_lwp_cb)(void *data); struct lwp_register_item { @@ -1710,6 +1662,9 @@ struct lwp_register_item { extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c); /* obd_mount.c */ +int lustre_unregister_fs(void); +int lustre_register_fs(void); +int lustre_check_exclusion(struct super_block *sb, char *svname); /* sysctl.c */ int obd_sysctl_init(void); @@ -1730,8 +1685,24 @@ void class_exit_uuidlist(void); extern char obd_jobid_node[]; extern struct miscdevice obd_psdev; extern spinlock_t obd_types_lock; +int class_procfs_init(void); +int class_procfs_clean(void); /* prng.c */ #define ll_generate_random_uuid(uuid_out) cfs_get_random_bytes(uuid_out, sizeof(class_uuid_t)) +/* statfs_pack.c */ +struct kstatfs; +void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs); +void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs); + +/* root squash info */ +struct rw_semaphore; +struct root_squash_info { + uid_t rsi_uid; + gid_t rsi_gid; + struct list_head rsi_nosquash_nids; + struct rw_semaphore rsi_sem; +}; + #endif /* __LINUX_OBD_CLASS_H */ |