Whamcloud - gitweb
LU-2785 osc: remove unused obd methods 47/8547/5
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 26 Feb 2014 23:48:13 +0000 (17:48 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 12 Mar 2014 15:04:55 +0000 (15:04 +0000)
Remove the unused methods osc_punch(), osc_sync(), osc_brw(),
osc_enqueue(), osc_cancel(), osc_llog_init(), osc_llog_finish(), and
their supporting functions. Remove the file obd_ost.h, moving all of
the structures defined there to osc_request.c. Remove several orphaned
obd methods.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I4148547c52625cb7b173f1b835c9e6e47e19e4f6
Reviewed-on: http://review.whamcloud.com/8547
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
21 files changed:
lustre/include/Makefile.am
lustre/include/lustre_lite.h
lustre/include/lustre_log.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/include/obd_ost.h [deleted file]
lustre/liblustre/tests/echo_test.c
lustre/lov/lov_internal.h
lustre/lov/lov_merge.c
lustre/lov/lov_obd.c
lustre/lov/lov_request.c
lustre/mgc/mgc_request.c
lustre/obdclass/debug.c
lustre/obdclass/genops.c
lustre/obdclass/lprocfs_status.c
lustre/ofd/ofd_internal.h
lustre/osc/osc_cl_internal.h
lustre/osc/osc_quota.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/recover.c

index 8544c61..da4e280 100644 (file)
@@ -89,6 +89,5 @@ EXTRA_DIST = \
        obd_cksum.h \
        obd_class.h \
        obd.h \
-       obd_ost.h \
        obd_support.h \
        obd_target.h
index 573841c..8e1a56b 100644 (file)
@@ -53,7 +53,6 @@
 #endif
 
 #include <obd_class.h>
-#include <obd_ost.h>
 #include <lustre_net.h>
 #include <lustre_mds.h>
 #include <lustre_ha.h>
index 1ccb8d4..bb69048 100644 (file)
@@ -67,7 +67,6 @@
 #endif
 
 #include <obd_class.h>
-#include <obd_ost.h>
 #include <lustre/lustre_idl.h>
 #include <dt_object.h>
 
index b9c2433..79924f9 100644 (file)
@@ -1081,10 +1081,6 @@ struct obd_ops {
                         struct lov_stripe_md *mem_src);
         int (*o_unpackmd)(struct obd_export *exp,struct lov_stripe_md **mem_tgt,
                           struct lov_mds_md *disk_src, int disk_len);
-        int (*o_preallocate)(struct lustre_handle *, obd_count *req,
-                             obd_id *ids);
-        /* FIXME: add fid capability support for create & destroy! */
-        int (*o_precreate)(struct obd_export *exp);
         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);
@@ -1104,28 +1100,6 @@ struct obd_ops {
                          struct obd_info *oinfo);
         int (*o_getattr_async)(struct obd_export *exp, struct obd_info *oinfo,
                                struct ptlrpc_request_set *set);
-        int (*o_brw)(int rw, struct obd_export *exp, struct obd_info *oinfo,
-                     obd_count oa_bufs, struct brw_page *pgarr,
-                     struct obd_trans_info *oti);
-        int (*o_merge_lvb)(struct obd_export *exp, struct lov_stripe_md *lsm,
-                           struct ost_lvb *lvb, int kms_only);
-        int (*o_adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm,
-                            obd_off size, int shrink);
-        int (*o_punch)(const struct lu_env *, struct obd_export *exp,
-                       struct obd_info *oinfo, struct obd_trans_info *oti,
-                       struct ptlrpc_request_set *rqset);
-        int (*o_sync)(const struct lu_env *env, struct obd_export *exp,
-                      struct obd_info *oinfo, obd_size start, obd_size end,
-                      struct ptlrpc_request_set *set);
-        int (*o_migrate)(struct lustre_handle *conn, struct lov_stripe_md *dst,
-                         struct lov_stripe_md *src, obd_size start,
-                         obd_size end, struct obd_trans_info *oti);
-        int (*o_copy)(struct lustre_handle *dstconn, struct lov_stripe_md *dst,
-                      struct lustre_handle *srconn, struct lov_stripe_md *src,
-                      obd_size start, obd_size end, struct obd_trans_info *);
-        int (*o_iterate)(struct lustre_handle *conn,
-                         int (*)(obd_id, obd_seq, void *),
-                         obd_id *startid, obd_seq seq, void *data);
         int (*o_preprw)(const struct lu_env *env, int cmd,
                         struct obd_export *exp, struct obdo *oa, int objcount,
                         struct obd_ioobj *obj, struct niobuf_remote *remote,
@@ -1137,21 +1111,12 @@ struct obd_ops {
                           struct niobuf_remote *remote, int pages,
                           struct niobuf_local *local,
                           struct obd_trans_info *oti, int rc);
-        int (*o_enqueue)(struct obd_export *, struct obd_info *oinfo,
-                         struct ldlm_enqueue_info *einfo,
-                         struct ptlrpc_request_set *rqset);
         int (*o_change_cbdata)(struct obd_export *, struct lov_stripe_md *,
                                ldlm_iterator_t it, void *data);
         int (*o_find_cbdata)(struct obd_export *, struct lov_stripe_md *,
                              ldlm_iterator_t it, void *data);
-        int (*o_cancel)(struct obd_export *, struct lov_stripe_md *md,
-                        __u32 mode, struct lustre_handle *);
-        int (*o_cancel_unused)(struct obd_export *, struct lov_stripe_md *,
-                               ldlm_cancel_flags_t flags, void *opaque);
         int (*o_init_export)(struct obd_export *exp);
         int (*o_destroy_export)(struct obd_export *exp);
-        int (*o_extent_calc)(struct obd_export *, struct lov_stripe_md *,
-                             int cmd, obd_off *);
 
         /* llog related obd_methods */
         int (*o_llog_init)(struct obd_device *obd, struct obd_llog_group *grp,
index 536e40b..ae759e7 100644 (file)
@@ -789,18 +789,6 @@ static inline int obd_free_memmd(struct obd_export *exp,
         return rc;
 }
 
-static inline int obd_precreate(struct obd_export *exp)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, precreate);
-        OBD_COUNTER_INCREMENT(exp->exp_obd, precreate);
-
-        rc = OBP(exp->exp_obd, precreate)(exp);
-        RETURN(rc);
-}
-
 static inline int obd_create_async(struct obd_export *exp,
                                    struct obd_info *oinfo,
                                    struct lov_stripe_md **ea,
@@ -1169,17 +1157,6 @@ static inline int obd_destroy_export(struct obd_export *exp)
         RETURN(0);
 }
 
-static inline int obd_extent_calc(struct obd_export *exp,
-                                  struct lov_stripe_md *md,
-                                  int cmd, obd_off *offset)
-{
-        int rc;
-        ENTRY;
-        EXP_CHECK_DT_OP(exp, extent_calc);
-        rc = OBP(exp->exp_obd, extent_calc)(exp, md, cmd, offset);
-        RETURN(rc);
-}
-
 /* @max_age is the oldest time in jiffies that we accept using a cached data.
  * If the cache is older than @max_age we will get a new value from the
  * target.  Use a value of "cfs_time_current() + HZ" to guarantee freshness. */
@@ -1281,97 +1258,6 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
        RETURN(rc);
 }
 
-static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo,
-                                 obd_size start, obd_size end)
-{
-        struct ptlrpc_request_set *set = NULL;
-        int rc;
-        ENTRY;
-
-        OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP);
-        EXP_COUNTER_INCREMENT(exp, sync);
-
-        set =  ptlrpc_prep_set();
-        if (set == NULL)
-                RETURN(-ENOMEM);
-
-        rc = OBP(exp->exp_obd, sync)(NULL, exp, oinfo, start, end, set);
-        if (rc == 0)
-                rc = ptlrpc_set_wait(set);
-        ptlrpc_set_destroy(set);
-        RETURN(rc);
-}
-
-static inline int obd_sync(const struct lu_env *env, struct obd_export *exp,
-                           struct obd_info *oinfo, obd_size start, obd_size end,
-                           struct ptlrpc_request_set *set)
-{
-        int rc;
-        ENTRY;
-
-        OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP);
-        EXP_COUNTER_INCREMENT(exp, sync);
-
-        rc = OBP(exp->exp_obd, sync)(env, exp, oinfo, start, end, set);
-        RETURN(rc);
-}
-
-static inline int obd_punch_rqset(struct obd_export *exp,
-                                  struct obd_info *oinfo,
-                                  struct obd_trans_info *oti)
-{
-        struct ptlrpc_request_set *set = NULL;
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, punch);
-        EXP_COUNTER_INCREMENT(exp, punch);
-
-        set =  ptlrpc_prep_set();
-        if (set == NULL)
-                RETURN(-ENOMEM);
-
-        rc = OBP(exp->exp_obd, punch)(NULL, exp, oinfo, oti, set);
-        if (rc == 0)
-                rc = ptlrpc_set_wait(set);
-        ptlrpc_set_destroy(set);
-        RETURN(rc);
-}
-
-static inline int obd_punch(const struct lu_env *env, struct obd_export *exp,
-                            struct obd_info *oinfo, struct obd_trans_info *oti,
-                            struct ptlrpc_request_set *rqset)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, punch);
-        EXP_COUNTER_INCREMENT(exp, punch);
-
-        rc = OBP(exp->exp_obd, punch)(env, exp, oinfo, oti, rqset);
-        RETURN(rc);
-}
-
-static inline int obd_brw(int cmd, struct obd_export *exp,
-                          struct obd_info *oinfo, obd_count oa_bufs,
-                          struct brw_page *pg, struct obd_trans_info *oti)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, brw);
-        EXP_COUNTER_INCREMENT(exp, brw);
-
-        if (!(cmd & (OBD_BRW_RWMASK | OBD_BRW_CHECK))) {
-                CERROR("obd_brw: cmd must be OBD_BRW_READ, OBD_BRW_WRITE, "
-                       "or OBD_BRW_CHECK\n");
-                LBUG();
-        }
-
-        rc = OBP(exp->exp_obd, brw)(cmd, exp, oinfo, oa_bufs, pg, oti);
-        RETURN(rc);
-}
-
 static inline int obd_preprw(const struct lu_env *env, int cmd,
                              struct obd_export *exp, struct obdo *oa,
                              int objcount, struct obd_ioobj *obj,
@@ -1408,34 +1294,6 @@ static inline int obd_commitrw(const struct lu_env *env, int cmd,
         RETURN(rc);
 }
 
-static inline int obd_merge_lvb(struct obd_export *exp,
-                                struct lov_stripe_md *lsm,
-                                struct ost_lvb *lvb, int kms_only)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, merge_lvb);
-        EXP_COUNTER_INCREMENT(exp, merge_lvb);
-
-        rc = OBP(exp->exp_obd, merge_lvb)(exp, lsm, lvb, kms_only);
-        RETURN(rc);
-}
-
-static inline int obd_adjust_kms(struct obd_export *exp,
-                                 struct lov_stripe_md *lsm, obd_off size,
-                                 int shrink)
-{
-        int rc;
-        ENTRY;
-
-        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 *uarg)
 {
@@ -1449,43 +1307,6 @@ static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp,
         RETURN(rc);
 }
 
-static inline int obd_enqueue_rqset(struct obd_export *exp,
-                                    struct obd_info *oinfo,
-                                    struct ldlm_enqueue_info *einfo)
-{
-        struct ptlrpc_request_set *set = NULL;
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, enqueue);
-        EXP_COUNTER_INCREMENT(exp, enqueue);
-
-        set =  ptlrpc_prep_set();
-        if (set == NULL)
-                RETURN(-ENOMEM);
-
-        rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set);
-        if (rc == 0)
-                rc = ptlrpc_set_wait(set);
-        ptlrpc_set_destroy(set);
-        RETURN(rc);
-}
-
-static inline int obd_enqueue(struct obd_export *exp,
-                              struct obd_info *oinfo,
-                              struct ldlm_enqueue_info *einfo,
-                              struct ptlrpc_request_set *set)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, enqueue);
-        EXP_COUNTER_INCREMENT(exp, enqueue);
-
-        rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set);
-        RETURN(rc);
-}
-
 static inline int obd_change_cbdata(struct obd_export *exp,
                                     struct lov_stripe_md *lsm,
                                     ldlm_iterator_t it, void *data)
@@ -1514,35 +1335,6 @@ static inline int obd_find_cbdata(struct obd_export *exp,
         RETURN(rc);
 }
 
-static inline int obd_cancel(struct obd_export *exp,
-                             struct lov_stripe_md *ea, __u32 mode,
-                             struct lustre_handle *lockh)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, cancel);
-        EXP_COUNTER_INCREMENT(exp, cancel);
-
-        rc = OBP(exp->exp_obd, cancel)(exp, ea, mode, lockh);
-        RETURN(rc);
-}
-
-static inline int obd_cancel_unused(struct obd_export *exp,
-                                    struct lov_stripe_md *ea,
-                                    ldlm_cancel_flags_t flags,
-                                    void *opaque)
-{
-        int rc;
-        ENTRY;
-
-        EXP_CHECK_DT_OP(exp, cancel_unused);
-        EXP_COUNTER_INCREMENT(exp, cancel_unused);
-
-        rc = OBP(exp->exp_obd, cancel_unused)(exp, ea, flags, opaque);
-        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)
diff --git a/lustre/include/obd_ost.h b/lustre/include/obd_ost.h
deleted file mode 100644 (file)
index 5debe02..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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, 2013, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/include/obd_ost.h
- *
- * Data structures for object storage targets and client: OST & OSC's
- *
- * See also lustre_idl.h for wire formats of requests.
- */
-
-#ifndef _LUSTRE_OST_H
-#define _LUSTRE_OST_H
-
-#include <obd_class.h>
-
-struct osc_brw_async_args {
-        struct obdo       *aa_oa;
-        int                aa_requested_nob;
-        int                aa_nio_count;
-        obd_count          aa_page_count;
-        int                aa_resends;
-        struct brw_page  **aa_ppga;
-        struct client_obd *aa_cli;
-        cfs_list_t         aa_oaps;
-       cfs_list_t         aa_exts;
-        struct obd_capa   *aa_ocapa;
-        struct cl_req     *aa_clerq;
-};
-
-#define osc_grant_args osc_brw_async_args
-struct osc_async_args {
-        struct obd_info   *aa_oi;
-};
-
-struct osc_setattr_args {
-        struct obdo         *sa_oa;
-        obd_enqueue_update_f sa_upcall;
-        void                *sa_cookie;
-};
-
-struct osc_fsync_args {
-       struct obd_info     *fa_oi;
-       obd_enqueue_update_f fa_upcall;
-       void                *fa_cookie;
-};
-
-struct osc_enqueue_args {
-        struct obd_export        *oa_exp;
-       __u64                    *oa_flags;
-        obd_enqueue_update_f      oa_upcall;
-        void                     *oa_cookie;
-        struct ost_lvb           *oa_lvb;
-        struct lustre_handle     *oa_lockh;
-        struct ldlm_enqueue_info *oa_ei;
-        unsigned int              oa_agl:1;
-};
-
-extern void osc_update_enqueue(struct lustre_handle *lov_lockhp,
-                              struct lov_oinfo *loi, __u64 flags,
-                              struct ost_lvb *lvb, __u32 mode, int rc);
-
-#if 0
-int osc_extent_blocking_cb(struct ldlm_lock *lock,
-                           struct ldlm_lock_desc *new, void *data,
-                           int flag);
-#endif
-
-#endif
index a602f12..b2fab3c 100644 (file)
@@ -39,7 +39,6 @@
 #include <liblustre.h>
 #include <obd.h>
 #include <obd_class.h>
-#include <obd_ost.h>
 
 #define LIBLUSTRE_TEST 1
 #include "../utils/lctl.c"
index 6a01148..72d6ee6 100644 (file)
@@ -128,8 +128,6 @@ static inline void lov_put_reqset(struct lov_request_set *set)
 /* lov_merge.c */
 void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_valid valid,
                      struct lov_stripe_md *lsm, int stripeno, int *set);
-int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
-                   obd_off size, int shrink);
 int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
                       struct ost_lvb *lvb, __u64 *kms_place);
 
index b7911c9..77da860 100644 (file)
@@ -116,46 +116,6 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
         RETURN(rc);
 }
 
-/* Must be called under the lov_stripe_lock() */
-int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
-                   obd_off size, int shrink)
-{
-        struct lov_oinfo *loi;
-        int stripe = 0;
-        __u64 kms;
-        ENTRY;
-
-       LASSERT(spin_is_locked(&lsm->lsm_lock));
-#ifdef __KERNEL__
-       LASSERT(lsm->lsm_lock_owner == current_pid());
-#endif
-
-        if (shrink) {
-                for (; stripe < lsm->lsm_stripe_count; stripe++) {
-                        struct lov_oinfo *loi = lsm->lsm_oinfo[stripe];
-                        kms = lov_size_to_stripe(lsm, size, stripe);
-                        CDEBUG(D_INODE,
-                               "stripe %d KMS %sing "LPU64"->"LPU64"\n",
-                               stripe, kms > loi->loi_kms ? "increas":"shrink",
-                               loi->loi_kms, kms);
-                        loi_kms_set(loi, loi->loi_lvb.lvb_size = kms);
-                }
-                RETURN(0);
-        }
-
-        if (size > 0)
-                stripe = lov_stripe_number(lsm, size - 1);
-        kms = lov_size_to_stripe(lsm, size, stripe);
-        loi = lsm->lsm_oinfo[stripe];
-
-        CDEBUG(D_INODE, "stripe %d KMS %sincreasing "LPU64"->"LPU64"\n",
-               stripe, kms > loi->loi_kms ? "" : "not ", loi->loi_kms, kms);
-        if (kms > loi->loi_kms)
-                loi_kms_set(loi, kms);
-
-        RETURN(0);
-}
-
 void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_valid valid,
                      struct lov_stripe_md *lsm, int stripeno, int *set)
 {
index 14ccf34..9d47ec5 100644 (file)
@@ -55,7 +55,6 @@
 #include <lustre_dlm.h>
 #include <lustre_mds.h>
 #include <obd_class.h>
-#include <obd_ost.h>
 #include <lprocfs_status.h>
 #include <lustre_param.h>
 #include <cl_object.h>
@@ -2344,7 +2343,6 @@ static struct obd_ops lov_obd_ops = {
        .o_destroy              = lov_destroy,
        .o_getattr_async        = lov_getattr_async,
        .o_setattr_async        = lov_setattr_async,
-       .o_adjust_kms           = lov_adjust_kms,
        .o_change_cbdata        = lov_change_cbdata,
        .o_find_cbdata          = lov_find_cbdata,
        .o_iocontrol            = lov_iocontrol,
index ddbca8c..bf5bfbc 100644 (file)
@@ -43,7 +43,6 @@
 #endif
 
 #include <obd_class.h>
-#include <obd_ost.h>
 #include <lustre/lustre_idl.h>
 
 #include "lov_internal.h"
index 32b000e..b282497 100644 (file)
@@ -1090,8 +1090,8 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
         RETURN(rc);
 }
 
-static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
-                      __u32 mode, struct lustre_handle *lockh)
+static int mgc_cancel(struct obd_export *exp, ldlm_mode_t mode,
+                     struct lustre_handle *lockh)
 {
         ENTRY;
 
@@ -1883,15 +1883,14 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
 
        mutex_unlock(&cld->cld_lock);
 
-        /* Now drop the lock so MGS can revoke it */
-        if (!rcl) {
-                rcl = mgc_cancel(mgc->u.cli.cl_mgc_mgsexp, NULL,
-                                 LCK_CR, &lockh);
-                if (rcl)
-                        CERROR("Can't drop cfg lock: %d\n", rcl);
-        }
+       /* Now drop the lock so MGS can revoke it */
+       if (!rcl) {
+               rcl = mgc_cancel(mgc->u.cli.cl_mgc_mgsexp, LCK_CR, &lockh);
+               if (rcl)
+                       CERROR("Can't drop cfg lock: %d\n", rcl);
+       }
 
-        RETURN(rc);
+       RETURN(rc);
 }
 
 
@@ -2015,9 +2014,6 @@ struct obd_ops mgc_obd_ops = {
         .o_del_conn     = client_import_del_conn,
         .o_connect      = client_connect_import,
         .o_disconnect   = client_disconnect_export,
-        //.o_enqueue      = mgc_enqueue,
-        .o_cancel       = mgc_cancel,
-        //.o_iocontrol    = mgc_iocontrol,
         .o_set_info_async = mgc_set_info_async,
         .o_get_info       = mgc_get_info,
         .o_import_event = mgc_import_event,
index e1d5ec2..4aa165f 100644 (file)
@@ -44,7 +44,6 @@
 # include <liblustre.h>
 #endif
 
-#include <obd_ost.h>
 #include <obd_support.h>
 #include <lustre_debug.h>
 #include <lustre_net.h>
index 20cd0a0..89c315e 100644 (file)
@@ -43,7 +43,6 @@
 #ifndef __KERNEL__
 #include <liblustre.h>
 #endif
-#include <obd_ost.h>
 #include <obd_class.h>
 #include <lprocfs_status.h>
 
index 973fd0b..29604ff 100644 (file)
@@ -2349,8 +2349,6 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats)
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, statfs_async);
         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, preallocate);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, precreate);
         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);
@@ -2358,24 +2356,12 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats)
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, setattr_async);
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, getattr);
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, getattr_async);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, brw);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, merge_lvb);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, adjust_kms);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, punch);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, sync);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, migrate);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, copy);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, iterate);
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, preprw);
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, commitrw);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, enqueue);
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, change_cbdata);
         LPROCFS_OBD_OP_INIT(num_private_stats, stats, find_cbdata);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, cancel);
-        LPROCFS_OBD_OP_INIT(num_private_stats, stats, cancel_unused);
         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, extent_calc);
         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);
index 5195dbc..b69a287 100644 (file)
@@ -42,7 +42,6 @@
 #include <dt_object.h>
 #include <md_object.h>
 #include <lustre_fid.h>
-#include <obd_ost.h>
 #include <lustre_capa.h>
 
 #define OFD_INIT_OBJID 0
index 08082da..d1a3dbf 100644 (file)
@@ -54,7 +54,6 @@
 
 #include <obd.h>
 /* osc_build_res_name() */
-#include <obd_ost.h>
 #include <cl_object.h>
 #include <lclient.h>
 #include "osc_internal.h"
index f22447b..79283fc 100644 (file)
@@ -31,7 +31,7 @@
 # include <liblustre.h>
 #endif
 
-#include <obd_ost.h>
+#include <obd.h>
 #include "osc_internal.h"
 
 static inline struct osc_quota_info *osc_oqi_alloc(obd_uid id)
index d1d793a..2b60765 100644 (file)
@@ -46,7 +46,6 @@
 #include <lustre_net.h>
 #include <lustre/lustre_user.h>
 #include <obd_cksum.h>
-#include <obd_ost.h>
 
 #ifdef  __CYGWIN__
 # include <ctype.h>
 #include "osc_internal.h"
 #include "osc_cl_internal.h"
 
-static void osc_release_ppga(struct brw_page **ppga, obd_count count);
-static int brw_interpret(const struct lu_env *env,
-                         struct ptlrpc_request *req, void *data, int rc);
-int osc_cleanup(struct obd_device *obd);
+struct osc_brw_async_args {
+       struct obdo              *aa_oa;
+       int                       aa_requested_nob;
+       int                       aa_nio_count;
+       obd_count                 aa_page_count;
+       int                       aa_resends;
+       struct brw_page **aa_ppga;
+       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;
+};
 
-/* Pack OSC object metadata for disk storage (LE byte order). */
-static int osc_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
-                     struct lov_stripe_md *lsm)
-{
-       int lmm_size;
-       ENTRY;
+#define osc_grant_args osc_brw_async_args
 
-       lmm_size = sizeof(**lmmp);
-       if (lmmp == NULL)
-               RETURN(lmm_size);
+struct osc_async_args {
+       struct obd_info *aa_oi;
+};
 
-       if (*lmmp != NULL && lsm == NULL) {
-               OBD_FREE(*lmmp, lmm_size);
-               *lmmp = NULL;
-               RETURN(0);
-       } else if (unlikely(lsm != NULL && ostid_id(&lsm->lsm_oi) == 0)) {
-               RETURN(-EBADF);
-       }
+struct osc_setattr_args {
+       struct obdo             *sa_oa;
+       obd_enqueue_update_f     sa_upcall;
+       void                    *sa_cookie;
+};
 
-       if (*lmmp == NULL) {
-               OBD_ALLOC(*lmmp, lmm_size);
-               if (*lmmp == NULL)
-                       RETURN(-ENOMEM);
-       }
+struct osc_fsync_args {
+       struct obd_info *fa_oi;
+       obd_enqueue_update_f     fa_upcall;
+       void                    *fa_cookie;
+};
 
-       if (lsm)
-               ostid_cpu_to_le(&lsm->lsm_oi, &(*lmmp)->lmm_oi);
+struct osc_enqueue_args {
+       struct obd_export               *oa_exp;
+       __u64                           *oa_flags;
+       obd_enqueue_update_f             oa_upcall;
+       void                            *oa_cookie;
+       struct ost_lvb                  *oa_lvb;
+       struct lustre_handle            *oa_lockh;
+       struct ldlm_enqueue_info        *oa_ei;
+       unsigned int                     oa_agl:1;
+};
 
-       RETURN(lmm_size);
-}
+static void osc_release_ppga(struct brw_page **ppga, obd_count count);
+static int brw_interpret(const struct lu_env *env, struct ptlrpc_request *req,
+                        void *data, int rc);
 
 /* Unpack OSC object metadata from disk storage (LE byte order). */
 static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
@@ -556,17 +566,6 @@ int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
         RETURN(0);
 }
 
-static int osc_punch(const struct lu_env *env, struct obd_export *exp,
-                     struct obd_info *oinfo, struct obd_trans_info *oti,
-                     struct ptlrpc_request_set *rqset)
-{
-        oinfo->oi_oa->o_size   = oinfo->oi_policy.l_extent.start;
-        oinfo->oi_oa->o_blocks = oinfo->oi_policy.l_extent.end;
-        oinfo->oi_oa->o_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
-        return osc_punch_base(exp, oinfo,
-                              oinfo->oi_cb_up, oinfo, rqset);
-}
-
 static int osc_sync_interpret(const struct lu_env *env,
                               struct ptlrpc_request *req,
                               void *arg, int rc)
@@ -635,24 +634,6 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
        RETURN (0);
 }
 
-static int osc_sync(const struct lu_env *env, struct obd_export *exp,
-                   struct obd_info *oinfo, obd_size start, obd_size end,
-                   struct ptlrpc_request_set *set)
-{
-       ENTRY;
-
-       if (!oinfo->oi_oa) {
-               CDEBUG(D_INFO, "oa NULL\n");
-               RETURN(-EINVAL);
-       }
-
-       oinfo->oi_oa->o_size = start;
-       oinfo->oi_oa->o_blocks = end;
-       oinfo->oi_oa->o_valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS);
-
-       RETURN(osc_sync_base(exp, oinfo, oinfo->oi_cb_up, oinfo, set));
-}
-
 /* Find and cancel locally locks matched by @mode in the resource found by
  * @objid. Found locks are added into @cancel list. Returns the amount of
  * locks added to @cancels list. */
@@ -1655,76 +1636,6 @@ out:
         RETURN(rc);
 }
 
-static int osc_brw_internal(int cmd, struct obd_export *exp, struct obdo *oa,
-                            struct lov_stripe_md *lsm,
-                            obd_count page_count, struct brw_page **pga,
-                            struct obd_capa *ocapa)
-{
-       struct ptlrpc_request *req;
-       int                    rc;
-       wait_queue_head_t            waitq;
-       int                    generation, resends = 0;
-       struct l_wait_info     lwi;
-
-       ENTRY;
-
-       init_waitqueue_head(&waitq);
-       generation = exp->exp_obd->u.cli.cl_import->imp_generation;
-
-restart_bulk:
-        rc = osc_brw_prep_request(cmd, &exp->exp_obd->u.cli, oa, lsm,
-                                  page_count, pga, &req, ocapa, 0, resends);
-        if (rc != 0)
-                return (rc);
-
-        if (resends) {
-                req->rq_generation_set = 1;
-                req->rq_import_generation = generation;
-                req->rq_sent = cfs_time_current_sec() + resends;
-        }
-
-        rc = ptlrpc_queue_wait(req);
-
-        if (rc == -ETIMEDOUT && req->rq_resend) {
-                DEBUG_REQ(D_HA, req,  "BULK TIMEOUT");
-                ptlrpc_req_finished(req);
-                goto restart_bulk;
-        }
-
-        rc = osc_brw_fini_request(req, rc);
-
-        ptlrpc_req_finished(req);
-        /* When server return -EINPROGRESS, client should always retry
-         * regardless of the number of times the bulk was resent already.*/
-        if (osc_recoverable_error(rc)) {
-                resends++;
-                if (rc != -EINPROGRESS &&
-                    !client_should_resend(resends, &exp->exp_obd->u.cli)) {
-                        CERROR("%s: too many resend retries for object: "
-                               ""DOSTID", rc = %d.\n", exp->exp_obd->obd_name,
-                              POSTID(&oa->o_oi), rc);
-                        goto out;
-                }
-               if (generation !=
-                   exp->exp_obd->u.cli.cl_import->imp_generation) {
-                       CDEBUG(D_HA, "%s: resend cross eviction for object: "
-                              ""DOSTID", rc = %d.\n", exp->exp_obd->obd_name,
-                              POSTID(&oa->o_oi), rc);
-                       goto out;
-               }
-
-                lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL,
-                                       NULL);
-                l_wait_event(waitq, 0, &lwi);
-
-                goto restart_bulk;
-        }
-out:
-        if (rc == -EAGAIN || rc == -EINPROGRESS)
-                rc = -EIO;
-        RETURN (rc);
-}
-
 static int osc_brw_redo_request(struct ptlrpc_request *request,
                                struct osc_brw_async_args *aa, int rc)
 {
@@ -1830,126 +1741,12 @@ static void sort_brw_pages(struct brw_page **array, int num)
         } while (stride > 1);
 }
 
-static obd_count max_unfragmented_pages(struct brw_page **pg, obd_count pages)
-{
-        int count = 1;
-        int offset;
-        int i = 0;
-
-        LASSERT (pages > 0);
-        offset = pg[i]->off & ~CFS_PAGE_MASK;
-
-        for (;;) {
-                pages--;
-                if (pages == 0)         /* that's all */
-                        return count;
-
-               if (offset + pg[i]->count < PAGE_CACHE_SIZE)
-                        return count;   /* doesn't end on page boundary */
-
-                i++;
-                offset = pg[i]->off & ~CFS_PAGE_MASK;
-                if (offset != 0)        /* doesn't start on page boundary */
-                        return count;
-
-                count++;
-        }
-}
-
-static struct brw_page **osc_build_ppga(struct brw_page *pga, obd_count count)
-{
-        struct brw_page **ppga;
-        int i;
-
-        OBD_ALLOC(ppga, sizeof(*ppga) * count);
-        if (ppga == NULL)
-                return NULL;
-
-        for (i = 0; i < count; i++)
-                ppga[i] = pga + i;
-        return ppga;
-}
-
 static void osc_release_ppga(struct brw_page **ppga, obd_count count)
 {
         LASSERT(ppga != NULL);
         OBD_FREE(ppga, sizeof(*ppga) * count);
 }
 
-static int osc_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
-                   obd_count page_count, struct brw_page *pga,
-                   struct obd_trans_info *oti)
-{
-        struct obdo *saved_oa = NULL;
-        struct brw_page **ppga, **orig;
-        struct obd_import *imp = class_exp2cliimp(exp);
-        struct client_obd *cli;
-        int rc, page_count_orig;
-        ENTRY;
-
-        LASSERT((imp != NULL) && (imp->imp_obd != NULL));
-        cli = &imp->imp_obd->u.cli;
-
-        if (cmd & OBD_BRW_CHECK) {
-                /* The caller just wants to know if there's a chance that this
-                 * I/O can succeed */
-
-                if (imp->imp_invalid)
-                        RETURN(-EIO);
-                RETURN(0);
-        }
-
-        /* test_brw with a failed create can trip this, maybe others. */
-        LASSERT(cli->cl_max_pages_per_rpc);
-
-        rc = 0;
-
-        orig = ppga = osc_build_ppga(pga, page_count);
-        if (ppga == NULL)
-                RETURN(-ENOMEM);
-        page_count_orig = page_count;
-
-        sort_brw_pages(ppga, page_count);
-        while (page_count) {
-                obd_count pages_per_brw;
-
-                if (page_count > cli->cl_max_pages_per_rpc)
-                        pages_per_brw = cli->cl_max_pages_per_rpc;
-                else
-                        pages_per_brw = page_count;
-
-                pages_per_brw = max_unfragmented_pages(ppga, pages_per_brw);
-
-                if (saved_oa != NULL) {
-                        /* restore previously saved oa */
-                        *oinfo->oi_oa = *saved_oa;
-                } else if (page_count > pages_per_brw) {
-                        /* save a copy of oa (brw will clobber it) */
-                        OBDO_ALLOC(saved_oa);
-                        if (saved_oa == NULL)
-                                GOTO(out, rc = -ENOMEM);
-                        *saved_oa = *oinfo->oi_oa;
-                }
-
-                rc = osc_brw_internal(cmd, exp, oinfo->oi_oa, oinfo->oi_md,
-                                      pages_per_brw, ppga, oinfo->oi_capa);
-
-                if (rc != 0)
-                        break;
-
-                page_count -= pages_per_brw;
-                ppga += pages_per_brw;
-        }
-
-out:
-        osc_release_ppga(orig, page_count_orig);
-
-        if (saved_oa != NULL)
-                OBDO_FREE(saved_oa);
-
-        RETURN(rc);
-}
-
 static int brw_interpret(const struct lu_env *env,
                          struct ptlrpc_request *req, void *data, int rc)
 {
@@ -2477,51 +2274,6 @@ static int osc_enqueue_interpret(const struct lu_env *env,
         return rc;
 }
 
-void osc_update_enqueue(struct lustre_handle *lov_lockhp,
-                       struct lov_oinfo *loi, __u64 flags,
-                       struct ost_lvb *lvb, __u32 mode, int rc)
-{
-        struct ldlm_lock *lock = ldlm_handle2lock(lov_lockhp);
-
-        if (rc == ELDLM_OK) {
-                __u64 tmp;
-
-                LASSERT(lock != NULL);
-                loi->loi_lvb = *lvb;
-                tmp = loi->loi_lvb.lvb_size;
-                /* Extend KMS up to the end of this lock and no further
-                 * A lock on [x,y] means a KMS of up to y + 1 bytes! */
-                if (tmp > lock->l_policy_data.l_extent.end)
-                        tmp = lock->l_policy_data.l_extent.end + 1;
-                if (tmp >= loi->loi_kms) {
-                        LDLM_DEBUG(lock, "lock acquired, setting rss="LPU64
-                                   ", kms="LPU64, loi->loi_lvb.lvb_size, tmp);
-                        loi_kms_set(loi, tmp);
-                } else {
-                        LDLM_DEBUG(lock, "lock acquired, setting rss="
-                                   LPU64"; leaving kms="LPU64", end="LPU64,
-                                   loi->loi_lvb.lvb_size, loi->loi_kms,
-                                   lock->l_policy_data.l_extent.end);
-                }
-                ldlm_lock_allow_match(lock);
-        } else if (rc == ELDLM_LOCK_ABORTED && (flags & LDLM_FL_HAS_INTENT)) {
-                LASSERT(lock != NULL);
-                loi->loi_lvb = *lvb;
-                ldlm_lock_allow_match(lock);
-                CDEBUG(D_INODE, "glimpsed, setting rss="LPU64"; leaving"
-                       " kms="LPU64"\n", loi->loi_lvb.lvb_size, loi->loi_kms);
-                rc = ELDLM_OK;
-        }
-
-        if (lock != NULL) {
-                if (rc != ELDLM_OK)
-                        ldlm_lock_fail_match(lock);
-
-                LDLM_LOCK_PUT(lock);
-        }
-}
-EXPORT_SYMBOL(osc_update_enqueue);
-
 struct ptlrpc_request_set *PTLRPCD_SET = (void *)1;
 
 /* When enqueuing asynchronously, locks are not ordered, we can obtain a lock
@@ -2675,23 +2427,6 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
         RETURN(rc);
 }
 
-static int osc_enqueue(struct obd_export *exp, struct obd_info *oinfo,
-                       struct ldlm_enqueue_info *einfo,
-                       struct ptlrpc_request_set *rqset)
-{
-        struct ldlm_res_id res_id;
-        int rc;
-        ENTRY;
-
-       ostid_build_res_name(&oinfo->oi_md->lsm_oi, &res_id);
-        rc = osc_enqueue_base(exp, &res_id, &oinfo->oi_flags, &oinfo->oi_policy,
-                              &oinfo->oi_md->lsm_oinfo[0]->loi_lvb,
-                              oinfo->oi_md->lsm_oinfo[0]->loi_kms_valid,
-                              oinfo->oi_cb_up, oinfo, einfo, oinfo->oi_lockh,
-                              rqset, rqset != NULL, 0);
-        RETURN(rc);
-}
-
 int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                   __u32 type, ldlm_policy_data_t *policy, __u32 mode,
                   __u64 *flags, void *data, struct lustre_handle *lockh,
@@ -2748,29 +2483,6 @@ int osc_cancel_base(struct lustre_handle *lockh, __u32 mode)
         RETURN(0);
 }
 
-static int osc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
-                      __u32 mode, struct lustre_handle *lockh)
-{
-        ENTRY;
-        RETURN(osc_cancel_base(lockh, mode));
-}
-
-static int osc_cancel_unused(struct obd_export *exp,
-                             struct lov_stripe_md *lsm,
-                             ldlm_cancel_flags_t flags,
-                             void *opaque)
-{
-        struct obd_device *obd = class_exp2obd(exp);
-        struct ldlm_res_id res_id, *resp = NULL;
-
-       if (lsm != NULL) {
-               ostid_build_res_name(&lsm->lsm_oi, &res_id);
-               resp = &res_id;
-       }
-
-        return ldlm_cli_cancel_unused(obd->obd_namespace, resp, flags, opaque);
-}
-
 static int osc_statfs_interpret(const struct lu_env *env,
                                 struct ptlrpc_request *req,
                                 struct osc_async_args *aa, int rc)
@@ -2912,70 +2624,6 @@ static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
         return rc;
 }
 
-/* Retrieve object striping information.
- *
- * @lmmu is a pointer to an in-core struct with lmm_ost_count indicating
- * the maximum number of OST indices which will fit in the user buffer.
- * lmm_magic must be LOV_MAGIC (we only use 1 slot here).
- */
-static int osc_getstripe(struct lov_stripe_md *lsm, struct lov_user_md *lump)
-{
-        /* we use lov_user_md_v3 because it is larger than lov_user_md_v1 */
-        struct lov_user_md_v3 lum, *lumk;
-        struct lov_user_ost_data_v1 *lmm_objects;
-        int rc = 0, lum_size;
-        ENTRY;
-
-        if (!lsm)
-                RETURN(-ENODATA);
-
-        /* we only need the header part from user space to get lmm_magic and
-         * lmm_stripe_count, (the header part is common to v1 and v3) */
-        lum_size = sizeof(struct lov_user_md_v1);
-       if (copy_from_user(&lum, lump, lum_size))
-                RETURN(-EFAULT);
-
-        if ((lum.lmm_magic != LOV_USER_MAGIC_V1) &&
-            (lum.lmm_magic != LOV_USER_MAGIC_V3))
-                RETURN(-EINVAL);
-
-        /* lov_user_md_vX and lov_mds_md_vX must have the same size */
-        LASSERT(sizeof(struct lov_user_md_v1) == sizeof(struct lov_mds_md_v1));
-        LASSERT(sizeof(struct lov_user_md_v3) == sizeof(struct lov_mds_md_v3));
-        LASSERT(sizeof(lum.lmm_objects[0]) == sizeof(lumk->lmm_objects[0]));
-
-        /* we can use lov_mds_md_size() to compute lum_size
-         * because lov_user_md_vX and lov_mds_md_vX have the same size */
-        if (lum.lmm_stripe_count > 0) {
-                lum_size = lov_mds_md_size(lum.lmm_stripe_count, lum.lmm_magic);
-                OBD_ALLOC(lumk, lum_size);
-                if (!lumk)
-                        RETURN(-ENOMEM);
-
-               if (lum.lmm_magic == LOV_USER_MAGIC_V1)
-                       lmm_objects =
-                           &(((struct lov_user_md_v1 *)lumk)->lmm_objects[0]);
-               else
-                       lmm_objects = &(lumk->lmm_objects[0]);
-               lmm_objects->l_ost_oi = lsm->lsm_oi;
-       } else {
-               lum_size = lov_mds_md_size(0, lum.lmm_magic);
-               lumk = &lum;
-       }
-
-       lumk->lmm_oi = lsm->lsm_oi;
-       lumk->lmm_stripe_count = 1;
-
-       if (copy_to_user(lump, lumk, lum_size))
-               rc = -EFAULT;
-
-       if (lumk != &lum)
-               OBD_FREE(lumk, lum_size);
-
-       RETURN(rc);
-}
-
-
 static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                          void *karg, void *uarg)
 {
@@ -2989,53 +2637,6 @@ static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                return -EINVAL;
        }
         switch (cmd) {
-        case OBD_IOC_LOV_GET_CONFIG: {
-                char *buf;
-                struct lov_desc *desc;
-                struct obd_uuid uuid;
-
-                buf = NULL;
-                len = 0;
-                if (obd_ioctl_getdata(&buf, &len, (void *)uarg))
-                        GOTO(out, err = -EINVAL);
-
-                data = (struct obd_ioctl_data *)buf;
-
-                if (sizeof(*desc) > data->ioc_inllen1) {
-                        obd_ioctl_freedata(buf, len);
-                        GOTO(out, err = -EINVAL);
-                }
-
-                if (data->ioc_inllen2 < sizeof(uuid)) {
-                        obd_ioctl_freedata(buf, len);
-                        GOTO(out, err = -EINVAL);
-                }
-
-                desc = (struct lov_desc *)data->ioc_inlbuf1;
-                desc->ld_tgt_count = 1;
-                desc->ld_active_tgt_count = 1;
-                desc->ld_default_stripe_count = 1;
-                desc->ld_default_stripe_size = 0;
-                desc->ld_default_stripe_offset = 0;
-                desc->ld_pattern = 0;
-                memcpy(&desc->ld_uuid, &obd->obd_uuid, sizeof(uuid));
-
-                memcpy(data->ioc_inlbuf2, &obd->obd_uuid, sizeof(uuid));
-
-               err = copy_to_user((void *)uarg, buf, len);
-                if (err)
-                        err = -EFAULT;
-                obd_ioctl_freedata(buf, len);
-                GOTO(out, err);
-        }
-        case LL_IOC_LOV_SETSTRIPE:
-                err = obd_alloc_memmd(exp, karg);
-                if (err > 0)
-                        err = 0;
-                GOTO(out, err);
-        case LL_IOC_LOV_GETSTRIPE:
-                err = osc_getstripe(karg, uarg);
-                GOTO(out, err);
         case OBD_IOC_CLIENT_RECOVER:
                 err = ptlrpc_recover_import(obd->u.cli.cl_import,
                                             data->ioc_inlbuf1, 0);
@@ -3316,34 +2917,6 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
         RETURN(0);
 }
 
-
-static int osc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
-                         struct obd_device *disk_obd, int *index)
-{
-       /* this code is not supposed to be used with LOD/OSP
-        * to be removed soon */
-       LBUG();
-       return 0;
-}
-
-static int osc_llog_finish(struct obd_device *obd, int count)
-{
-       struct llog_ctxt *ctxt;
-
-       ENTRY;
-
-       ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT);
-       if (ctxt) {
-               llog_cat_close(NULL, ctxt->loc_handle);
-               llog_cleanup(NULL, ctxt);
-       }
-
-       ctxt = llog_get_context(obd, LLOG_SIZE_REPL_CTXT);
-       if (ctxt)
-               llog_cleanup(NULL, ctxt);
-       RETURN(0);
-}
-
 static int osc_reconnect(const struct lu_env *env,
                          struct obd_export *exp, struct obd_device *obd,
                          struct obd_uuid *cluuid,
@@ -3685,7 +3258,6 @@ struct obd_ops osc_obd_ops = {
         .o_disconnect           = osc_disconnect,
         .o_statfs               = osc_statfs,
         .o_statfs_async         = osc_statfs_async,
-        .o_packmd               = osc_packmd,
         .o_unpackmd             = osc_unpackmd,
         .o_create               = osc_create,
         .o_destroy              = osc_destroy,
@@ -3693,20 +3265,12 @@ struct obd_ops osc_obd_ops = {
         .o_getattr_async        = osc_getattr_async,
         .o_setattr              = osc_setattr,
         .o_setattr_async        = osc_setattr_async,
-        .o_brw                  = osc_brw,
-        .o_punch                = osc_punch,
-        .o_sync                 = osc_sync,
-        .o_enqueue              = osc_enqueue,
         .o_change_cbdata        = osc_change_cbdata,
         .o_find_cbdata          = osc_find_cbdata,
-        .o_cancel               = osc_cancel,
-        .o_cancel_unused        = osc_cancel_unused,
         .o_iocontrol            = osc_iocontrol,
         .o_get_info             = osc_get_info,
         .o_set_info_async       = osc_set_info_async,
         .o_import_event         = osc_import_event,
-        .o_llog_init            = osc_llog_init,
-        .o_llog_finish          = osc_llog_finish,
         .o_process_config       = osc_process_config,
         .o_quotactl             = osc_quotactl,
         .o_quotacheck           = osc_quotacheck,
index baab8be..f7448d4 100644 (file)
@@ -42,9 +42,9 @@
 #define DEBUG_SUBSYSTEM S_OST
 
 #include <linux/module.h>
-#include <obd_ost.h>
 #include <lustre_dlm.h>
 #include <lprocfs_status.h>
+#include <obd_class.h>
 #include "ost_internal.h"
 
 static int oss_num_threads;
index 64b7196..42363fd 100644 (file)
@@ -51,7 +51,6 @@
 #include <lustre_import.h>
 #include <lustre_export.h>
 #include <obd.h>
-#include <obd_ost.h>
 #include <obd_class.h>
 #include <libcfs/list.h>