From: John L. Hammond Date: Sun, 25 May 2014 23:37:01 +0000 (-0400) Subject: LU-2675 obd: remove dead code X-Git-Tag: 2.5.60~42 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=14d162c5438de959d0ea01fb1b40a7c5dfa764d1 LU-2675 obd: remove dead code Remove unused OBD functions: obdo_to_inode(), is_osp_on_mdt(), oti_init(), oti_alloc_cookies(), oti_free_cookies(), obdo_from_iattr(), obdo_from_md(), obd_create_async(), obd_pin(), obd_unpin(), obd_llog_connect(), obd_pin_observer(), obd_unpin_observer(), md_is_subdir(), md_readpage(), obdo2fid(). Remove several unused, get-only, and set-only structure members. Signed-off-by: John L. Hammond Signed-off-by: James Simmons Change-Id: I4a9567798259cfde0cf0ab0ae691daac21e29b9c Reviewed-on: http://review.whamcloud.com/9784 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger --- diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 2d2abbd..60dfe3f 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -54,10 +54,10 @@ /* obdo.c */ #ifdef __KERNEL__ -void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid); +void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid); void la_from_obdo(struct lu_attr *la, const struct obdo *dst, obd_flag valid); -void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid); -void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid); +void obdo_refresh_inode(struct inode *dst, const struct obdo *src, + obd_flag valid); #define ll_inode_flags(inode) (inode->i_flags) #endif diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 1ed9850..6aec746 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -2132,8 +2132,8 @@ typedef enum { MDS_DISCONNECT = 39, MDS_GETSTATUS = 40, MDS_STATFS = 41, - MDS_PIN = 42, - MDS_UNPIN = 43, + MDS_PIN = 42, /* obsolete, never used in a release */ + MDS_UNPIN = 43, /* obsolete, never used in a release */ MDS_SYNC = 44, MDS_DONE_WRITING = 45, MDS_SET_INFO = 46, @@ -2142,7 +2142,7 @@ typedef enum { MDS_GETXATTR = 49, MDS_SETXATTR = 50, /* obsolete, now it's MDS_REINT op */ MDS_WRITEPAGE = 51, - MDS_IS_SUBDIR = 52, + MDS_IS_SUBDIR = 52, /* obsolete, never used in a release */ MDS_GET_INFO = 53, MDS_HSM_STATE_GET = 54, MDS_HSM_STATE_SET = 55, diff --git a/lustre/include/lustre_import.h b/lustre/include/lustre_import.h index e30f688..1182308 100644 --- a/lustre/include/lustre_import.h +++ b/lustre/include/lustre_import.h @@ -310,28 +310,6 @@ struct obd_import { time_t imp_last_reply_time; /* for health check */ }; -typedef void (*obd_import_callback)(struct obd_import *imp, void *closure, - int event, void *event_arg, void *cb_data); - -/** - * Structure for import observer. - * It is possible to register "observer" on an import and every time - * something happens to an import (like connect/evict/disconnect) - * obderver will get its callback called with event type - */ -struct obd_import_observer { - cfs_list_t oio_chain; - obd_import_callback oio_cb; - void *oio_cb_data; -}; - -void class_observe_import(struct obd_import *imp, obd_import_callback cb, - void *cb_data); -void class_unobserve_import(struct obd_import *imp, obd_import_callback cb, - void *cb_data); -void class_notify_import_observers(struct obd_import *imp, int event, - void *event_arg); - /* import.c */ static inline unsigned int at_est2timeout(unsigned int val) { diff --git a/lustre/include/lustre_log.h b/lustre/include/lustre_log.h index 446e1ca..9f74de2 100644 --- a/lustre/include/lustre_log.h +++ b/lustre/include/lustre_log.h @@ -410,12 +410,11 @@ static inline void llog_ctxt_put(struct llog_ctxt *ctxt) __llog_ctxt_put(NULL, ctxt); } -static inline void llog_group_init(struct obd_llog_group *olg, int group) +static inline void llog_group_init(struct obd_llog_group *olg) { init_waitqueue_head(&olg->olg_waitq); spin_lock_init(&olg->olg_lock); mutex_init(&olg->olg_cat_processing); - olg->olg_seq = group; } static inline int llog_group_set_ctxt(struct obd_llog_group *olg, diff --git a/lustre/include/lustre_req_layout.h b/lustre/include/lustre_req_layout.h index 1a834ea..fb57f19 100644 --- a/lustre/include/lustre_req_layout.h +++ b/lustre/include/lustre_req_layout.h @@ -166,14 +166,11 @@ extern struct req_format RQF_OUT_UPDATE; extern struct req_format RQF_MDS_GETATTR_NAME; extern struct req_format RQF_MDS_CLOSE; extern struct req_format RQF_MDS_RELEASE_CLOSE; -extern struct req_format RQF_MDS_PIN; -extern struct req_format RQF_MDS_UNPIN; extern struct req_format RQF_MDS_CONNECT; extern struct req_format RQF_MDS_DISCONNECT; extern struct req_format RQF_MDS_GET_INFO; extern struct req_format RQF_MDS_READPAGE; extern struct req_format RQF_MDS_WRITEPAGE; -extern struct req_format RQF_MDS_IS_SUBDIR; extern struct req_format RQF_MDS_DONE_WRITING; extern struct req_format RQF_MDS_REINT; extern struct req_format RQF_MDS_REINT_CREATE; diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 565ae38..1007438 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -163,8 +163,6 @@ struct obd_info { - while setattr, the flags used for distinguish punch operation */ __u64 oi_flags; - /* Lock handle specific for every OSC lock. */ - struct lustre_handle *oi_lockh; /* lsm data specific for every OSC. */ struct lov_stripe_md *oi_md; /* obdo data specific for every OSC, if needed at all. */ @@ -179,8 +177,6 @@ struct obd_info { /* oss capability, its type is obd_capa in client to avoid copy. * in contrary its type is lustre_capa in OSS. */ void *oi_capa; - /* transfer jobid from ost_sync() to filter_sync()... */ - char *oi_jobid; }; struct obd_type { @@ -208,15 +204,9 @@ enum llog_ctxt_id { LLOG_CONFIG_ORIG_CTXT = 0, LLOG_CONFIG_REPL_CTXT, LLOG_MDS_OST_ORIG_CTXT, - LLOG_MDS_OST_REPL_CTXT, LLOG_SIZE_ORIG_CTXT, LLOG_SIZE_REPL_CTXT, - LLOG_RD1_ORIG_CTXT, - LLOG_RD1_REPL_CTXT, LLOG_TEST_ORIG_CTXT, - LLOG_TEST_REPL_CTXT, - LLOG_LOVEA_ORIG_CTXT, - LLOG_LOVEA_REPL_CTXT, LLOG_CHANGELOG_ORIG_CTXT, /**< changelog generation on mdd */ LLOG_CHANGELOG_REPL_CTXT, /**< changelog access on clients */ LLOG_CHANGELOG_USER_ORIG_CTXT, /**< for multiple changelog consumers */ @@ -286,7 +276,6 @@ struct client_obd { /* A chunk is an optimal size used by osc_extent to determine * the extent size. A chunk is max(PAGE_CACHE_SIZE, OST block size) */ int cl_chunkbits; - int cl_chunk; int cl_extent_tax; /* extent overhead, by bytes */ /* keep track of objects that have lois that contain pages which @@ -494,7 +483,6 @@ struct niobuf_local { __u32 flags; struct page *page; struct dentry *dentry; - int lnb_grant_used; int rc; }; @@ -533,119 +521,21 @@ struct niobuf_local { #define LUSTRE_MGS_OBDNAME "MGS" #define LUSTRE_MGC_OBDNAME "MGC" -static inline int is_osp_on_mdt(char *name) -{ - char *ptr; - - ptr = strrchr(name, '-'); - if (ptr == NULL) { - CERROR("%s is not a obdname\n", name); - return 0; - } - - /* 1.8 OSC/OSP name on MDT is fsname-OSTxxxx-osc */ - if (strncmp(ptr + 1, "osc", 3) == 0) - return 1; - - if (strncmp(ptr + 1, "MDT", 3) != 0) - return 0; - - while (*(--ptr) != '-' && ptr != name); - - if (ptr == name) - return 0; - - if (strncmp(ptr + 1, LUSTRE_OSP_NAME, strlen(LUSTRE_OSP_NAME)) != 0 && - strncmp(ptr + 1, LUSTRE_OSC_NAME, strlen(LUSTRE_OSC_NAME)) != 0) - return 0; - - return 1; -} - -/* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */ -#define N_LOCAL_TEMP_PAGE 0x10000000 - struct obd_trans_info { - __u64 oti_transno; - __u64 oti_xid; - /* Only used on the server side for tracking acks. */ - struct oti_req_ack_lock { - struct lustre_handle lock; - __u32 mode; - } oti_ack_locks[4]; - void *oti_handle; - struct llog_cookie oti_onecookie; - struct llog_cookie *oti_logcookies; - int oti_numcookies; - /** synchronous write is needed */ - unsigned long oti_sync_write:1; - - /* initial thread handling transaction */ - struct ptlrpc_thread * oti_thread; - __u32 oti_conn_cnt; - /** VBR: versions */ - __u64 oti_pre_version; - /** JobID */ - char *oti_jobid; - - struct obd_uuid *oti_ost_uuid; + __u64 oti_xid; + /* Only used on the server side for tracking acks. */ + struct oti_req_ack_lock { + struct lustre_handle lock; + __u32 mode; + } oti_ack_locks[4]; + void *oti_handle; + struct llog_cookie oti_onecookie; + struct llog_cookie *oti_logcookies; + + /** VBR: versions */ + __u64 oti_pre_version; }; -static inline void oti_init(struct obd_trans_info *oti, - struct ptlrpc_request *req) -{ - if (oti == NULL) - return; - memset(oti, 0, sizeof(*oti)); - - if (req == NULL) - return; - - oti->oti_xid = req->rq_xid; - /** VBR: take versions from request */ - if (req->rq_reqmsg != NULL && - lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) { - __u64 *pre_version = lustre_msg_get_versions(req->rq_reqmsg); - oti->oti_pre_version = pre_version ? pre_version[0] : 0; - oti->oti_transno = lustre_msg_get_transno(req->rq_reqmsg); - } - - /** called from mds_create_objects */ - if (req->rq_repmsg != NULL) - oti->oti_transno = lustre_msg_get_transno(req->rq_repmsg); - oti->oti_thread = req->rq_svc_thread; - if (req->rq_reqmsg != NULL) - oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg); -} - -static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies) -{ - if (!oti) - return; - - if (num_cookies == 1) - oti->oti_logcookies = &oti->oti_onecookie; - else - OBD_ALLOC_LARGE(oti->oti_logcookies, - num_cookies * sizeof(oti->oti_onecookie)); - - oti->oti_numcookies = num_cookies; -} - -static inline void oti_free_cookies(struct obd_trans_info *oti) -{ - if (!oti || !oti->oti_logcookies) - return; - - if (oti->oti_logcookies == &oti->oti_onecookie) - LASSERT(oti->oti_numcookies == 1); - else - OBD_FREE_LARGE(oti->oti_logcookies, - oti->oti_numcookies*sizeof(oti->oti_onecookie)); - oti->oti_logcookies = NULL; - oti->oti_numcookies = 0; -} - /* * Events signalled through obd_notify() upcall-chain. */ @@ -698,7 +588,6 @@ struct target_recovery_data { }; struct obd_llog_group { - int olg_seq; struct llog_ctxt *olg_ctxts[LLOG_MAX_CTXTS]; wait_queue_head_t olg_waitq; spinlock_t olg_lock; @@ -733,7 +622,6 @@ struct obd_device { obd_starting:1, /* started setup */ obd_force:1, /* cleanup with > 0 obd refcount */ obd_fail:1, /* cleanup with failover */ - obd_async_recov:1, /* allow asynchronous orphan cleanup */ obd_no_conn:1, /* deny new connections */ obd_inactive:1, /* device active/inactive * (for /proc/status only!!) */ @@ -781,7 +669,6 @@ struct obd_device { int obd_max_recoverable_clients; atomic_t obd_connected_clients; int obd_stale_clients; - int obd_delayed_clients; /* this lock protects all recovery list_heads, timer and * obd_next_recovery_transno value */ spinlock_t obd_recovery_task_lock; @@ -851,9 +738,6 @@ struct obd_device { int obd_conn_inprogress; }; -#define OBD_LLOG_FL_SENDNOW 0x0001 -#define OBD_LLOG_FL_EXIT 0x0002 - enum obd_cleanup_stage { /* Special case hack for MDS LOVs */ OBD_CLEANUP_EARLY, @@ -863,8 +747,6 @@ enum obd_cleanup_stage { /* get/set_info keys */ #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" @@ -877,13 +759,11 @@ enum obd_cleanup_stage { #define KEY_GRANT_SHRINK "grant_shrink" #define KEY_HSM_COPYTOOL_SEND "hsm_send" #define KEY_INIT_RECOV_BACKUP "init_recov_bk" -#define KEY_INIT_RECOV "initial_recov" #define KEY_INTERMDS "inter_mds" #define KEY_LAST_ID "last_id" #define KEY_LAST_FID "last_fid" #define KEY_LOCK_TO_STRIPE "lock_to_stripe" #define KEY_LOVDESC "lovdesc" -#define KEY_LOV_IDX "lov_idx" #define KEY_MAX_EASIZE "max_easize" #define KEY_DEFAULT_EASIZE "default_easize" #define KEY_MAX_COOKIESIZE "max_cookiesize" @@ -898,11 +778,9 @@ enum obd_cleanup_stage { /* KEY_SET_INFO in lustre_idl.h */ #define KEY_SPTLRPC_CONF "sptlrpc_conf" #define KEY_CONNECT_FLAG "connect_flags" -#define KEY_SYNC_LOCK_CANCEL "sync_lock_cancel" #define KEY_CACHE_SET "cache_set" #define KEY_CACHE_LRU_SHRINK "cache_lru_shrink" -#define KEY_CHANGELOG_INDEX "changelog_index" #define KEY_OSP_CONNECTED "osp_connected" struct lu_context; @@ -964,9 +842,6 @@ struct md_op_data { /* iattr fields and blocks. */ struct iattr op_attr; -#ifdef __KERNEL__ - unsigned int op_attr_flags; -#endif __u64 op_valid; loff_t op_attr_blocks; @@ -1036,8 +911,6 @@ struct obd_ops { __u32 keylen, void *key, __u32 vallen, void *val, struct ptlrpc_request_set *set); - int (*o_attach)(struct obd_device *dev, obd_count len, void *data); - int (*o_detach)(struct obd_device *dev); int (*o_setup) (struct obd_device *dev, struct lustre_cfg *cfg); int (*o_precleanup)(struct obd_device *dev, enum obd_cleanup_stage cleanup_stage); @@ -1087,9 +960,6 @@ struct obd_ops { 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_create_async)(struct obd_export *exp, struct obd_info *oinfo, - 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, @@ -1125,12 +995,6 @@ struct obd_ops { int (*o_llog_init)(struct obd_device *obd, struct obd_llog_group *grp, struct obd_device *disk_obd, int *idx); int (*o_llog_finish)(struct obd_device *obd, int count); - int (*o_llog_connect)(struct obd_export *, struct llogd_conn_body *); - - /* metadata-only methods */ - int (*o_pin)(struct obd_export *, const struct lu_fid *fid, - struct obd_capa *, struct obd_client_handle *, int flag); - int (*o_unpin)(struct obd_export *, struct obd_client_handle *, int); int (*o_import_event)(struct obd_device *, struct obd_import *, enum obd_import_event); @@ -1175,7 +1039,6 @@ struct lustre_md { struct mdt_remote_perm *remote_perm; struct obd_capa *mds_capa; struct obd_capa *oss_capa; - __u64 lm_flags; }; struct md_open_data { @@ -1236,9 +1099,6 @@ struct md_ops { int (*m_fsync)(struct obd_export *, const struct lu_fid *, struct obd_capa *, struct ptlrpc_request **); - int (*m_readpage)(struct obd_export *, struct md_op_data *, - struct page **, struct ptlrpc_request **); - int (*m_read_entry)(struct obd_export *, struct md_op_data *, struct md_callback *cb_op, struct lu_dirent **ld, struct page **ppage); @@ -1279,10 +1139,6 @@ struct md_ops { int (*m_getattr_name)(struct obd_export *, struct md_op_data *, struct ptlrpc_request **); - int (*m_is_subdir)(struct obd_export *, const struct lu_fid *, - const struct lu_fid *, - struct ptlrpc_request **); - int (*m_init_ea_size)(struct obd_export *, int, int, int, int); int (*m_get_lustre_md)(struct obd_export *, struct ptlrpc_request *, @@ -1361,15 +1217,6 @@ static inline const struct lsm_operations *lsm_op_find(int magic) } } -/* Requests for obd_extent_calc() */ -#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; diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 741991b..962f789 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -70,7 +70,6 @@ * by the request interpret routine */ #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]; @@ -334,14 +333,10 @@ static inline struct lr_server_data *class_server_data(struct obd_device *obd) } #endif -void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid); -void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj); -void obdo_from_iattr(struct obdo *oa, struct iattr *attr, - unsigned int ia_valid); -void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid); -void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, obd_flag valid); -void obdo_from_md(struct obdo *oa, struct md_op_data *op_data, - unsigned int valid); +void obdo_cpy_md(struct obdo *dst, const struct obdo *src, obd_flag 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, + obd_flag valid); #define OBT(dev) (dev)->obd_type #define OBP(dev, op) (dev)->obd_type->typ_dt_ops->o_ ## op @@ -789,21 +784,6 @@ static inline int obd_free_memmd(struct obd_export *exp, return rc; } -static inline int obd_create_async(struct obd_export *exp, - struct obd_info *oinfo, - struct lov_stripe_md **ea, - struct obd_trans_info *oti) -{ - int rc; - ENTRY; - - EXP_CHECK_DT_OP(exp, create_async); - EXP_COUNTER_INCREMENT(exp, create_async); - - rc = OBP(exp->exp_obd, create_async)(exp, oinfo, ea, oti); - RETURN(rc); -} - 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) @@ -1336,34 +1316,6 @@ static inline int obd_find_cbdata(struct obd_export *exp, RETURN(rc); } -static inline int obd_pin(struct obd_export *exp, const struct lu_fid *fid, - struct obd_capa *oc, struct obd_client_handle *handle, - int flag) -{ - int rc; - ENTRY; - - EXP_CHECK_DT_OP(exp, pin); - EXP_COUNTER_INCREMENT(exp, pin); - - rc = OBP(exp->exp_obd, pin)(exp, fid, oc, handle, flag); - RETURN(rc); -} - -static inline int obd_unpin(struct obd_export *exp, - struct obd_client_handle *handle, int flag) -{ - int rc; - ENTRY; - - EXP_CHECK_DT_OP(exp, unpin); - EXP_COUNTER_INCREMENT(exp, unpin); - - rc = OBP(exp->exp_obd, unpin)(exp, handle, flag); - RETURN(rc); -} - - static inline void obd_import_event(struct obd_device *obd, struct obd_import *imp, enum obd_import_event event) @@ -1381,20 +1333,6 @@ static inline void obd_import_event(struct obd_device *obd, EXIT; } -static inline int obd_llog_connect(struct obd_export *exp, - struct llogd_conn_body *body) -{ - int rc; - ENTRY; - - OBD_CHECK_DT_OP(exp->exp_obd, llog_connect, 0); - EXP_COUNTER_INCREMENT(exp, llog_connect); - - rc = OBP(exp->exp_obd, llog_connect)(exp, body); - RETURN(rc); -} - - static inline int obd_notify(struct obd_device *obd, struct obd_device *watched, enum obd_notify_event ev, @@ -1404,11 +1342,7 @@ static inline int obd_notify(struct obd_device *obd, ENTRY; OBD_CHECK_DEV(obd); - /* 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); } @@ -1518,82 +1452,6 @@ static inline int obd_register_observer(struct obd_device *obd, RETURN(0); } -static inline int obd_pin_observer(struct obd_device *obd, - struct obd_device **observer) -{ - ENTRY; - down_read(&obd->obd_observer_link_sem); - if (!obd->obd_observer) { - *observer = NULL; - up_read(&obd->obd_observer_link_sem); - RETURN(-ENOENT); - } - *observer = obd->obd_observer; - RETURN(0); -} - -static inline int obd_unpin_observer(struct obd_device *obd) -{ - ENTRY; - up_read(&obd->obd_observer_link_sem); - RETURN(0); -} - -#if 0 -static inline int obd_register_page_removal_cb(struct obd_export *exp, - obd_page_removal_cb_t cb, - obd_pin_extent_cb pin_cb) -{ - int rc; - ENTRY; - - OBD_CHECK_DT_OP(exp->exp_obd, register_page_removal_cb, 0); - OBD_COUNTER_INCREMENT(exp->exp_obd, register_page_removal_cb); - - rc = OBP(exp->exp_obd, register_page_removal_cb)(exp, cb, pin_cb); - RETURN(rc); -} - -static inline int obd_unregister_page_removal_cb(struct obd_export *exp, - obd_page_removal_cb_t cb) -{ - int rc; - ENTRY; - - OBD_CHECK_DT_OP(exp->exp_obd, unregister_page_removal_cb, 0); - OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_page_removal_cb); - - rc = OBP(exp->exp_obd, unregister_page_removal_cb)(exp, cb); - RETURN(rc); -} - -static inline int obd_register_lock_cancel_cb(struct obd_export *exp, - obd_lock_cancel_cb cb) -{ - int rc; - ENTRY; - - OBD_CHECK_DT_OP(exp->exp_obd, register_lock_cancel_cb, 0); - OBD_COUNTER_INCREMENT(exp->exp_obd, register_lock_cancel_cb); - - rc = OBP(exp->exp_obd, register_lock_cancel_cb)(exp, cb); - RETURN(rc); -} - -static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp, - obd_lock_cancel_cb cb) -{ - int rc; - ENTRY; - - OBD_CHECK_DT_OP(exp->exp_obd, unregister_lock_cancel_cb, 0); - OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_lock_cancel_cb); - - rc = OBP(exp->exp_obd, unregister_lock_cancel_cb)(exp, cb); - RETURN(rc); -} -#endif - /* metadata helpers */ static inline int md_getstatus(struct obd_export *exp, struct lu_fid *fid, struct obd_capa **pc) @@ -1748,19 +1606,6 @@ 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; - ENTRY; - 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, struct ptlrpc_request **request, @@ -1786,18 +1631,6 @@ static inline int md_fsync(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) -{ - int rc; - ENTRY; - EXP_CHECK_MD_OP(exp, readpage); - EXP_MD_COUNTER_INCREMENT(exp, readpage); - rc = MDP(exp->exp_obd, readpage)(exp, opdata, pages, request); - RETURN(rc); -} - static inline int md_read_entry(struct obd_export *exp, struct md_op_data *op_data, struct md_callback *cb_op, @@ -2058,16 +1891,6 @@ do { \ } while(0) -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 { diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 15ce082..bb156f2 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -72,7 +72,6 @@ extern unsigned int at_max; extern unsigned int at_history; extern int at_early_margin; extern int at_extra; -extern unsigned int obd_sync_filter; extern unsigned int obd_max_dirty_pages; extern atomic_t obd_unstable_pages; extern atomic_t obd_dirty_pages; diff --git a/lustre/include/obd_target.h b/lustre/include/obd_target.h index cbe415c..968a508 100644 --- a/lustre/include/obd_target.h +++ b/lustre/include/obd_target.h @@ -53,14 +53,11 @@ struct obd_device_target { struct filter_obd { /* NB this field MUST be first */ struct obd_device_target fo_obt; - rwlock_t fo_sptlrpc_lock; - struct sptlrpc_rule_set fo_sptlrpc_rset; /* capability related */ unsigned int fo_fl_oss_capa; cfs_list_t fo_capa_keys; cfs_hlist_head_t *fo_capa_hash; - int fo_sec_level; }; struct echo_obd { diff --git a/lustre/mdc/mdc_internal.h b/lustre/mdc/mdc_internal.h index 2e5dcdb..b3edfde 100644 --- a/lustre/mdc/mdc_internal.h +++ b/lustre/mdc/mdc_internal.h @@ -50,8 +50,6 @@ void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid, void mdc_pack_capa(struct ptlrpc_request *req, const struct req_msg_field *field, struct obd_capa *oc); 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, diff --git a/lustre/mdc/mdc_lib.c b/lustre/mdc/mdc_lib.c index dcc6348..48e1b7f 100644 --- a/lustre/mdc/mdc_lib.c +++ b/lustre/mdc/mdc_lib.c @@ -83,21 +83,6 @@ void mdc_pack_capa(struct ptlrpc_request *req, const struct req_msg_field *field 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) -{ - struct mdt_body *b = req_capsule_client_get(&req->rq_pill, - &RMF_MDT_BODY); - - if (pfid) { - b->fid1 = *pfid; - b->valid = OBD_MD_FLID; - } - if (cfid) - b->fid2 = *cfid; - b->flags = flags; -} - void mdc_swap_layouts_pack(struct ptlrpc_request *req, struct md_op_data *op_data) { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index aca1807..fddf7ae 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -313,34 +313,6 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data, RETURN(rc); } -static int mdc_is_subdir(struct obd_export *exp, - const struct lu_fid *pfid, - const struct lu_fid *cfid, - struct ptlrpc_request **request) -{ - struct ptlrpc_request *req; - int rc; - - ENTRY; - - *request = NULL; - req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), - &RQF_MDS_IS_SUBDIR, LUSTRE_MDS_VERSION, - MDS_IS_SUBDIR); - if (req == NULL) - RETURN(-ENOMEM); - - mdc_is_subdir_pack(req, pfid, cfid, 0); - ptlrpc_request_set_replen(req); - - rc = ptlrpc_queue_wait(req); - if (rc && rc != -EREMOTE) - ptlrpc_req_finished(req); - else - *request = req; - RETURN(rc); -} - static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt, const struct lu_fid *fid, struct obd_capa *oc, int opcode, obd_valid valid, @@ -2916,93 +2888,6 @@ int mdc_get_info(const struct lu_env *env, struct obd_export *exp, RETURN(rc); } -static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid, - struct obd_capa *oc, struct obd_client_handle *handle, - int flags) -{ - struct ptlrpc_request *req; - struct mdt_body *body; - int rc; - ENTRY; - - req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_PIN); - if (req == NULL) - RETURN(-ENOMEM); - - mdc_set_capa_size(req, &RMF_CAPA1, oc); - - rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_PIN); - if (rc) { - ptlrpc_request_free(req); - RETURN(rc); - } - - mdc_pack_body(req, fid, oc, 0, 0, -1, flags); - - ptlrpc_request_set_replen(req); - - mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); - rc = ptlrpc_queue_wait(req); - mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); - if (rc) { - CERROR("Pin failed: %d\n", rc); - GOTO(err_out, rc); - } - - body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY); - if (body == NULL) - GOTO(err_out, rc = -EPROTO); - - handle->och_fh = body->handle; - handle->och_magic = OBD_CLIENT_HANDLE_MAGIC; - - handle->och_mod = obd_mod_alloc(); - if (handle->och_mod == NULL) { - DEBUG_REQ(D_ERROR, req, "can't allocate md_open_data"); - GOTO(err_out, rc = -ENOMEM); - } - handle->och_mod->mod_open_req = req; /* will be dropped by unpin */ - - RETURN(0); - -err_out: - ptlrpc_req_finished(req); - RETURN(rc); -} - -static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle, - int flag) -{ - struct ptlrpc_request *req; - struct mdt_body *body; - int rc; - ENTRY; - - req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_MDS_UNPIN, - LUSTRE_MDS_VERSION, MDS_UNPIN); - if (req == NULL) - RETURN(-ENOMEM); - - body = req_capsule_client_get(&req->rq_pill, &RMF_MDT_BODY); - body->handle = handle->och_fh; - body->flags = flag; - - ptlrpc_request_set_replen(req); - - mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); - rc = ptlrpc_queue_wait(req); - mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); - - if (rc != 0) - CERROR("Unpin failed: %d\n", rc); - - ptlrpc_req_finished(req); - ptlrpc_req_finished(handle->och_mod->mod_open_req); - - obd_mod_put(handle->och_mod); - RETURN(rc); -} - int mdc_fsync(struct obd_export *exp, const struct lu_fid *fid, struct obd_capa *oc, struct ptlrpc_request **request) { @@ -3404,8 +3289,6 @@ struct obd_ops mdc_obd_ops = { .o_iocontrol = mdc_iocontrol, .o_set_info_async = mdc_set_info_async, .o_statfs = mdc_statfs, - .o_pin = mdc_pin, - .o_unpin = mdc_unpin, .o_fid_init = client_fid_init, .o_fid_fini = client_fid_fini, .o_fid_alloc = mdc_fid_alloc, @@ -3431,7 +3314,6 @@ struct md_ops mdc_md_ops = { .m_getattr_name = mdc_getattr_name, .m_intent_lock = mdc_intent_lock, .m_link = mdc_link, - .m_is_subdir = mdc_is_subdir, .m_rename = mdc_rename, .m_setattr = mdc_setattr, .m_setxattr = mdc_setxattr, diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 63ccac0..86db768 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1164,35 +1164,6 @@ out: return rc; } -static int mdt_is_subdir(struct tgt_session_info *tsi) -{ - struct mdt_thread_info *info = tsi2mdt_info(tsi); - struct mdt_object *o = info->mti_object; - struct req_capsule *pill = info->mti_pill; - const struct mdt_body *body = info->mti_body; - struct mdt_body *repbody; - int rc; - ENTRY; - - LASSERT(o != NULL); - - repbody = req_capsule_server_get(pill, &RMF_MDT_BODY); - - /* - * We save last checked parent fid to @repbody->fid1 for remote - * directory case. - */ - LASSERT(fid_is_sane(&body->fid2)); - LASSERT(mdt_object_exists(o) && !mdt_object_remote(o)); - rc = mdo_is_subdir(info->mti_env, mdt_object_child(o), - &body->fid2, &repbody->fid1); - if (rc == 0 || rc == -EREMOTE) - repbody->valid |= OBD_MD_FLID; - - mdt_thread_info_fini(info); - RETURN(rc); -} - static int mdt_swap_layouts(struct tgt_session_info *tsi) { struct mdt_thread_info *info; @@ -4257,7 +4228,6 @@ TGT_MDT_HDL(HABEO_CORPUS, MDS_DONE_WRITING, mdt_done_writing), TGT_MDT_HDL(HABEO_CORPUS| HABEO_REFERO, MDS_READPAGE, mdt_readpage), TGT_MDT_HDL(HABEO_CORPUS| HABEO_REFERO, MDS_SYNC, mdt_sync), -TGT_MDT_HDL(HABEO_CORPUS| HABEO_REFERO, MDS_IS_SUBDIR, mdt_is_subdir), TGT_MDT_HDL(0, MDS_QUOTACTL, mdt_quotactl), TGT_MDT_HDL(HABEO_CORPUS| HABEO_REFERO | MUTABOR, MDS_HSM_PROGRESS, mdt_hsm_progress), diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 6b09174..f08fe35 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -200,19 +200,6 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, } EXPORT_SYMBOL(obd_alloc_fail); -static inline void obd_data2conn(struct lustre_handle *conn, - struct obd_ioctl_data *data) -{ - memset(conn, 0, sizeof *conn); - conn->cookie = data->ioc_cookie; -} - -static inline void obd_conn2data(struct obd_ioctl_data *data, - struct lustre_handle *conn) -{ - data->ioc_cookie = conn->cookie; -} - int class_resolve_dev_name(__u32 len, const char *name) { int rc; @@ -685,7 +672,6 @@ EXPORT_SYMBOL(obd_pages_max); #ifdef __KERNEL__ static void cleanup_obdclass(void) { - int i; int lustre_unregister_fs(void); __u64 memory_leaked, pages_leaked; __u64 memory_max, pages_max; @@ -694,15 +680,6 @@ static void cleanup_obdclass(void) lustre_unregister_fs(); misc_deregister(&obd_psdev); - for (i = 0; i < class_devno_max(); i++) { - struct obd_device *obd = class_num2obd(i); - if (obd && obd->obd_set_up && - OBT(obd) && OBP(obd, detach)) { - /* XXX should this call generic detach otherwise? */ - LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC); - OBP(obd, detach)(obd); - } - } llog_info_fini(); #ifdef HAVE_SERVER_SUPPORT lu_ucred_global_fini(); diff --git a/lustre/obdclass/darwin/darwin-sysctl.c b/lustre/obdclass/darwin/darwin-sysctl.c index 0ed3736..e636f41 100644 --- a/lustre/obdclass/darwin/darwin-sysctl.c +++ b/lustre/obdclass/darwin/darwin-sysctl.c @@ -55,7 +55,6 @@ int proc_obd_timeout SYSCTL_HANDLER_ARGS; extern unsigned int obd_dump_on_timeout; extern unsigned int obd_timeout; extern unsigned int ldlm_timeout; -extern unsigned int obd_sync_filter; extern atomic_t obd_memory; int read_build_version SYSCTL_HANDLER_ARGS; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index d7c541a..ad5473b 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -1187,8 +1187,6 @@ void class_export_recovery_cleanup(struct obd_export *exp) struct obd_device *obd = exp->exp_obd; spin_lock(&obd->obd_recovery_task_lock); - if (exp->exp_delayed) - obd->obd_delayed_clients--; if (obd->obd_recovering) { if (exp->exp_in_recovery) { spin_lock(&exp->exp_lock); diff --git a/lustre/obdclass/linux/linux-obdo.c b/lustre/obdclass/linux/linux-obdo.c index 5af2ff6..97192ff 100644 --- a/lustre/obdclass/linux/linux-obdo.c +++ b/lustre/obdclass/linux/linux-obdo.c @@ -42,20 +42,14 @@ #define DEBUG_SUBSYSTEM S_CLASS -#ifndef __KERNEL__ -#include -#else -#include -#include -#include -#endif - -#ifdef __KERNEL__ #include +#include #include /* for PAGE_CACHE_SIZE */ +#include +#include /*FIXME: Just copy from obdo_from_inode*/ -void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid) +void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid) { obd_flag newvalid = 0; @@ -158,7 +152,8 @@ void la_from_obdo(struct lu_attr *dst, const struct obdo *obdo, obd_flag valid) } EXPORT_SYMBOL(la_from_obdo); -void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid) +void obdo_refresh_inode(struct inode *dst, const struct obdo *src, + obd_flag valid) { valid &= src->o_valid; @@ -192,44 +187,3 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid) dst->i_blocks = src->o_blocks; } EXPORT_SYMBOL(obdo_refresh_inode); - -void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid) -{ - valid &= src->o_valid; - - LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID | - OBD_MD_FLID | OBD_MD_FLGROUP)), - "object "DOSTID", valid %x\n", POSTID(&src->o_oi), valid); - - if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) - CDEBUG(D_INODE, - "valid "LPX64", cur time %lu/%lu, new "LPU64"/"LPU64"\n", - src->o_valid, LTIME_S(dst->i_mtime), - LTIME_S(dst->i_ctime), src->o_mtime, src->o_ctime); - - if (valid & OBD_MD_FLATIME) - LTIME_S(dst->i_atime) = src->o_atime; - if (valid & OBD_MD_FLMTIME) - LTIME_S(dst->i_mtime) = src->o_mtime; - if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(dst->i_ctime)) - LTIME_S(dst->i_ctime) = src->o_ctime; - if (valid & OBD_MD_FLSIZE) - i_size_write(dst, src->o_size); - if (valid & OBD_MD_FLBLOCKS) { /* allocation of space */ - dst->i_blocks = src->o_blocks; - if (dst->i_blocks < src->o_blocks) /* overflow */ - dst->i_blocks = -1; - } - if (valid & OBD_MD_FLBLKSZ) - dst->i_blkbits = ffs(src->o_blksize)-1; - if (valid & OBD_MD_FLMODE) - dst->i_mode = (dst->i_mode & S_IFMT) | (src->o_mode & ~S_IFMT); - if (valid & OBD_MD_FLUID) - dst->i_uid = make_kuid(&init_user_ns, src->o_uid); - if (valid & OBD_MD_FLGID) - dst->i_gid = make_kgid(&init_user_ns, src->o_gid); - if (valid & OBD_MD_FLFLAGS) - dst->i_flags = src->o_flags; -} -EXPORT_SYMBOL(obdo_to_inode); -#endif diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 4226176..3be5dfd 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -2134,10 +2134,8 @@ void lprocfs_init_mps_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_MD_OP_INIT(num_private_stats, stats, intent_lock); LPROCFS_MD_OP_INIT(num_private_stats, stats, link); LPROCFS_MD_OP_INIT(num_private_stats, stats, rename); - LPROCFS_MD_OP_INIT(num_private_stats, stats, is_subdir); LPROCFS_MD_OP_INIT(num_private_stats, stats, setattr); LPROCFS_MD_OP_INIT(num_private_stats, stats, fsync); - LPROCFS_MD_OP_INIT(num_private_stats, stats, readpage); LPROCFS_MD_OP_INIT(num_private_stats, stats, read_entry); LPROCFS_MD_OP_INIT(num_private_stats, stats, unlink); LPROCFS_MD_OP_INIT(num_private_stats, stats, setxattr); diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index a943b7b..3ba8e70 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -624,8 +624,6 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, iocontrol); LPROCFS_OBD_OP_INIT(num_private_stats, stats, get_info); LPROCFS_OBD_OP_INIT(num_private_stats, stats, set_info_async); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, attach); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, detach); LPROCFS_OBD_OP_INIT(num_private_stats, stats, setup); LPROCFS_OBD_OP_INIT(num_private_stats, stats, precleanup); LPROCFS_OBD_OP_INIT(num_private_stats, stats, cleanup); @@ -644,7 +642,6 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, packmd); LPROCFS_OBD_OP_INIT(num_private_stats, stats, unpackmd); LPROCFS_OBD_OP_INIT(num_private_stats, stats, create); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, create_async); LPROCFS_OBD_OP_INIT(num_private_stats, stats, destroy); LPROCFS_OBD_OP_INIT(num_private_stats, stats, setattr); LPROCFS_OBD_OP_INIT(num_private_stats, stats, setattr_async); @@ -657,10 +654,7 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, init_export); LPROCFS_OBD_OP_INIT(num_private_stats, stats, destroy_export); LPROCFS_OBD_OP_INIT(num_private_stats, stats, llog_init); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, llog_connect); LPROCFS_OBD_OP_INIT(num_private_stats, stats, llog_finish); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, pin); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, unpin); LPROCFS_OBD_OP_INIT(num_private_stats, stats, import_event); LPROCFS_OBD_OP_INIT(num_private_stats, stats, notify); LPROCFS_OBD_OP_INIT(num_private_stats, stats, health_check); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 03730a3..c85a594 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -414,7 +414,7 @@ int class_attach(struct lustre_cfg *lcfg) CFS_INIT_LIST_HEAD(&obd->obd_evict_list); INIT_LIST_HEAD(&obd->obd_lwp_list); - llog_group_init(&obd->obd_olg, FID_SEQ_LLOG); + llog_group_init(&obd->obd_olg); obd->obd_conn_inprogress = 0; @@ -426,13 +426,6 @@ int class_attach(struct lustre_cfg *lcfg) } memcpy(obd->obd_uuid.uuid, uuid, len); - /* do the attach */ - if (OBP(obd, attach)) { - rc = OBP(obd,attach)(obd, sizeof *lcfg, lcfg); - if (rc) - GOTO(out, rc = -EINVAL); - } - /* Detach drops this */ spin_lock(&obd->obd_dev_lock); atomic_set(&obd->obd_refcount, 1); @@ -759,11 +752,7 @@ void class_decref(struct obd_device *obd, const char *scope, const void *source) CERROR("Cleanup %s returned %d\n", obd->obd_name, err); } - if (OBP(obd, detach)) { - err = OBP(obd, detach)(obd); - if (err) - CERROR("Detach returned %d\n", err); - } + class_release_dev(obd); } } diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index 5604600..7cf1ca0 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -119,7 +119,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid) } EXPORT_SYMBOL(obdo_from_inode); -void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid) +void obdo_cpy_md(struct obdo *dst, const struct obdo *src, obd_flag valid) { #ifdef __KERNEL__ CDEBUG(D_INODE, "src obdo "DOSTID" valid "LPX64", dst obdo "DOSTID"\n", @@ -162,50 +162,7 @@ void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid) } EXPORT_SYMBOL(obdo_cpy_md); -/* returns FALSE if comparison (by flags) is same, TRUE if changed */ -int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_flag compare) -{ - int res = 0; - - if ( compare & OBD_MD_FLATIME ) - res = (res || (dst->o_atime != src->o_atime)); - if ( compare & OBD_MD_FLMTIME ) - res = (res || (dst->o_mtime != src->o_mtime)); - if ( compare & OBD_MD_FLCTIME ) - res = (res || (dst->o_ctime != src->o_ctime)); - if ( compare & OBD_MD_FLSIZE ) - res = (res || (dst->o_size != src->o_size)); - if ( compare & OBD_MD_FLBLOCKS ) /* allocation of space */ - res = (res || (dst->o_blocks != src->o_blocks)); - if ( compare & OBD_MD_FLBLKSZ ) - res = (res || (dst->o_blksize != src->o_blksize)); - if ( compare & OBD_MD_FLTYPE ) - res = (res || (((dst->o_mode ^ src->o_mode) & S_IFMT) != 0)); - if ( compare & OBD_MD_FLMODE ) - res = (res || (((dst->o_mode ^ src->o_mode) & ~S_IFMT) != 0)); - if ( compare & OBD_MD_FLUID ) - res = (res || (dst->o_uid != src->o_uid)); - if ( compare & OBD_MD_FLGID ) - res = (res || (dst->o_gid != src->o_gid)); - if ( compare & OBD_MD_FLFLAGS ) - res = (res || (dst->o_flags != src->o_flags)); - if ( compare & OBD_MD_FLNLINK ) - res = (res || (dst->o_nlink != src->o_nlink)); - if ( compare & OBD_MD_FLFID ) { - res = (res || (dst->o_parent_seq != src->o_parent_seq)); - res = (res || (dst->o_parent_ver != src->o_parent_ver)); - } - if ( compare & OBD_MD_FLGENER ) - res = (res || (dst->o_parent_oid != src->o_parent_oid)); - /* XXX Don't know if thses should be included here - wasn't previously - if ( compare & OBD_MD_FLINLINE ) - res = (res || memcmp(dst->o_inline, src->o_inline)); - */ - return res; -} -EXPORT_SYMBOL(obdo_cmp_md); - -void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj) +void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj) { ioobj->ioo_oid = oa->o_oi; if (unlikely(!(oa->o_valid & OBD_MD_FLGROUP))) @@ -217,43 +174,8 @@ void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj) } EXPORT_SYMBOL(obdo_to_ioobj); -void obdo_from_iattr(struct obdo *oa, struct iattr *attr, unsigned int ia_valid) -{ - if (ia_valid & ATTR_ATIME) { - oa->o_atime = LTIME_S(attr->ia_atime); - oa->o_valid |= OBD_MD_FLATIME; - } - if (ia_valid & ATTR_MTIME) { - oa->o_mtime = LTIME_S(attr->ia_mtime); - oa->o_valid |= OBD_MD_FLMTIME; - } - if (ia_valid & ATTR_CTIME) { - oa->o_ctime = LTIME_S(attr->ia_ctime); - oa->o_valid |= OBD_MD_FLCTIME; - } - if (ia_valid & ATTR_SIZE) { - oa->o_size = attr->ia_size; - oa->o_valid |= OBD_MD_FLSIZE; - } - if (ia_valid & ATTR_MODE) { - oa->o_mode = attr->ia_mode; - oa->o_valid |= OBD_MD_FLTYPE | OBD_MD_FLMODE; - if (!in_group_p(make_kgid(&init_user_ns, oa->o_gid)) && - !cfs_capable(CFS_CAP_FSETID)) - oa->o_mode &= ~S_ISGID; - } - if (ia_valid & ATTR_UID) { - oa->o_uid = from_kuid(&init_user_ns, attr->ia_uid); - oa->o_valid |= OBD_MD_FLUID; - } - if (ia_valid & ATTR_GID) { - oa->o_gid = from_kgid(&init_user_ns, attr->ia_gid); - oa->o_valid |= OBD_MD_FLGID; - } -} -EXPORT_SYMBOL(obdo_from_iattr); - -void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid) +static void iattr_from_obdo(struct iattr *attr, const struct obdo *oa, + obd_flag valid) { valid &= oa->o_valid; @@ -300,9 +222,9 @@ void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid) attr->ia_valid |= ATTR_GID; } } -EXPORT_SYMBOL(iattr_from_obdo); -void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, obd_flag valid) +void md_from_obdo(struct md_op_data *op_data, const struct obdo *oa, + obd_flag valid) { iattr_from_obdo(&op_data->op_attr, oa, valid); if (valid & OBD_MD_FLBLOCKS) { @@ -316,19 +238,3 @@ void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, obd_flag valid) } } EXPORT_SYMBOL(md_from_obdo); - -void obdo_from_md(struct obdo *oa, struct md_op_data *op_data, - unsigned int valid) -{ - obdo_from_iattr(oa, &op_data->op_attr, valid); - if (valid & ATTR_BLOCKS) { - oa->o_blocks = op_data->op_attr_blocks; - oa->o_valid |= OBD_MD_FLBLOCKS; - } - if (valid & ATTR_ATTR_FLAG) { - oa->o_flags = - ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags; - oa->o_valid |= OBD_MD_FLFLAGS; - } -} -EXPORT_SYMBOL(obdo_from_md); diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 6cf3c00..b893534 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -2534,7 +2534,6 @@ static int echo_client_prep_commit(const struct lu_env *env, } ioo.ioo_bufcnt = npages; - oti->oti_transno = 0; lpages = npages; ret = obd_preprw(env, rw, exp, oa, 1, &ioo, rnb, &lpages, diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index ae96044..99445a9 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -2131,8 +2131,6 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m, spin_lock_init(&m->ofd_inconsistency_lock); spin_lock_init(&m->ofd_batch_lock); - rwlock_init(&obd->u.filter.fo_sptlrpc_lock); - sptlrpc_rule_set_init(&obd->u.filter.fo_sptlrpc_rset); init_rwsem(&m->ofd_lastid_rwsem); obd->u.filter.fo_fl_oss_capa = 0; diff --git a/lustre/ofd/ofd_io.c b/lustre/ofd/ofd_io.c index fcb1c8d..6b2d48f 100644 --- a/lustre/ofd/ofd_io.c +++ b/lustre/ofd/ofd_io.c @@ -584,7 +584,7 @@ int ofd_preprw(const struct lu_env *env, int cmd, struct obd_export *exp, LASSERT(oti != NULL); info = ofd_info_init(env, exp); ofd_oti2info(info, oti); - jobid = oti->oti_jobid; + jobid = NULL; } else { info = tsi2ofd_info(tsi); jobid = tsi->tsi_jobid; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 3416fe3..ece4142 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -503,11 +503,10 @@ int osc_real_create(struct obd_export *exp, struct obdo *oa, *ea = lsm; if (oti != NULL) { - oti->oti_transno = lustre_msg_get_transno(req->rq_repmsg); - if (oa->o_valid & OBD_MD_FLCOOKIE) { - if (!oti->oti_logcookies) - oti_alloc_cookies(oti, 1); + if (oti->oti_logcookies == NULL) + oti->oti_logcookies = &oti->oti_onecookie; + *oti->oti_logcookies = oa->o_lcookie; } } diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 0a73cb0..1e4e915 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -458,12 +458,6 @@ int osd_bufs_get(const struct lu_env *env, struct dt_object *d, loff_t pos, osd_map_remote_to_local(pos, len, &npages, lnb); for (i = 0; i < npages; i++, lnb++) { - - /* We still set up for ungranted pages so that granted pages - * can be written to disk as they were promised, and portals - * needs to keep the pages all aligned properly. */ - lnb->dentry = (void *) obj; - lnb->page = osd_get_page(d, lnb->lnb_file_offset, rw); if (lnb->page == NULL) GOTO(cleanup, rc = -ENOMEM); diff --git a/lustre/ptlrpc/layout.c b/lustre/ptlrpc/layout.c index af36c72..4ecd9b5 100644 --- a/lustre/ptlrpc/layout.c +++ b/lustre/ptlrpc/layout.c @@ -725,11 +725,8 @@ static struct req_format *req_formats[] = { &RQF_MDS_SYNC, &RQF_MDS_CLOSE, &RQF_MDS_RELEASE_CLOSE, - &RQF_MDS_PIN, - &RQF_MDS_UNPIN, &RQF_MDS_READPAGE, &RQF_MDS_WRITEPAGE, - &RQF_MDS_IS_SUBDIR, &RQF_MDS_DONE_WRITING, &RQF_MDS_REINT, &RQF_MDS_REINT_CREATE, @@ -1513,15 +1510,6 @@ struct req_format RQF_MDS_RELEASE_CLOSE = mdt_release_close_client, mds_last_unlink_server); EXPORT_SYMBOL(RQF_MDS_RELEASE_CLOSE); -struct req_format RQF_MDS_PIN = - DEFINE_REQ_FMT0("MDS_PIN", - mdt_body_capa, mdt_body_only); -EXPORT_SYMBOL(RQF_MDS_PIN); - -struct req_format RQF_MDS_UNPIN = - DEFINE_REQ_FMT0("MDS_UNPIN", mdt_body_only, empty); -EXPORT_SYMBOL(RQF_MDS_UNPIN); - struct req_format RQF_MDS_DONE_WRITING = DEFINE_REQ_FMT0("MDS_DONE_WRITING", mdt_close_client, mdt_body_only); @@ -1572,11 +1560,6 @@ struct req_format RQF_MDS_WRITEPAGE = mdt_body_capa, mdt_body_only); EXPORT_SYMBOL(RQF_MDS_WRITEPAGE); -struct req_format RQF_MDS_IS_SUBDIR = - DEFINE_REQ_FMT0("MDS_IS_SUBDIR", - mdt_body_only, mdt_body_only); -EXPORT_SYMBOL(RQF_MDS_IS_SUBDIR); - struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE = DEFINE_REQ_FMT0("LLOG_ORIGIN_HANDLE_CREATE", llog_origin_handle_create_client, llogd_body_only);