Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / mds / mds_internal.h
index 25fad02..af32d2f 100644 (file)
@@ -5,10 +5,28 @@
 #ifndef _MDS_INTERNAL_H
 #define _MDS_INTERNAL_H
 
-#include <linux/lustre_mds.h>
-#include <linux/lustre_audit.h>
+#include <lustre_disk.h>
+#include <lustre_mds.h>
+
+#define MDT_ROCOMPAT_SUPP       (OBD_ROCOMPAT_LOVOBJID)
+#define MDT_INCOMPAT_SUPP       (OBD_INCOMPAT_MDT | OBD_INCOMPAT_COMMON_LR)
+
+/* Data stored per client in the last_rcvd file.  In le32 order. */
+struct mds_client_data {
+        __u8 mcd_uuid[40];      /* client UUID */
+        __u64 mcd_last_transno; /* last completed transaction ID */
+        __u64 mcd_last_xid;     /* xid for the last transaction */
+        __u32 mcd_last_result;  /* result from last RPC */
+        __u32 mcd_last_data;    /* per-op data (disposition for open &c.) */
+        /* for MDS_CLOSE requests */
+        __u64 mcd_last_close_transno; /* last completed transaction ID */
+        __u64 mcd_last_close_xid;     /* xid for the last transaction */
+        __u32 mcd_last_close_result;  /* result from last RPC */
+        __u32 mcd_last_close_data;  /* per-op data (disposition for open &c.) */
+        __u8 mcd_padding[LR_CLIENT_SIZE - 88];
+};
 
-#define MDS_SERVICE_WATCHDOG_TIMEOUT 30000
+#define MDS_SERVICE_WATCHDOG_TIMEOUT (obd_timeout * 1000)
 
 #define MAX_ATIME_DIFF 60
 
@@ -16,25 +34,12 @@ struct mds_filter_data {
         __u64 io_epoch;
 };
 
-#define MDS_FILTERDATA(inode) ((struct mds_filter_data *)LUSTRE_FILTERDATA(inode))
-#define DENTRY_VALID(dentry)    \
-        ((dentry)->d_inode || ((dentry)->d_flags & DCACHE_CROSS_REF))
-
-#define MDS_NO_SPLIT_EXPECTED   0
-#define MDS_EXPECT_SPLIT        1
-#define MDS_NO_SPLITTABLE       2
-
-/* 1048576 should be enough for one client pool */
-#define MDS_FIDEXT_SIZE (1 << 20)
+#define MDS_FILTERDATA(inode) ((struct mds_filter_data *)(inode)->i_filterdata)
 
 static inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req)
 {
         return &req->rq_export->exp_obd->u.mds;
 }
-static inline struct obd_device *req2obd(struct ptlrpc_request *req)
-{
-        return req->rq_export->exp_obd;
-}
 
 #ifdef __KERNEL__
 /* Open counts for files.  No longer atomic, must hold inode->i_sem */
@@ -44,6 +49,26 @@ static inline struct obd_device *req2obd(struct ptlrpc_request *req)
 # define mds_inode_oatomic(inode)    ((inode)->i_attr_flags)
 #endif
 
+#ifdef HAVE_I_ALLOC_SEM
+#define MDS_UP_READ_ORPHAN_SEM(i)          UP_READ_I_ALLOC_SEM(i)
+#define MDS_DOWN_READ_ORPHAN_SEM(i)        DOWN_READ_I_ALLOC_SEM(i)
+#define LASSERT_MDS_ORPHAN_READ_LOCKED(i)  LASSERT_I_ALLOC_SEM_READ_LOCKED(i)
+
+#define MDS_UP_WRITE_ORPHAN_SEM(i)         UP_WRITE_I_ALLOC_SEM(i)
+#define MDS_DOWN_WRITE_ORPHAN_SEM(i)       DOWN_WRITE_I_ALLOC_SEM(i)
+#define LASSERT_MDS_ORPHAN_WRITE_LOCKED(i) LASSERT_I_ALLOC_SEM_WRITE_LOCKED(i)
+#define MDS_PACK_MD_LOCK 1
+#else
+#define MDS_UP_READ_ORPHAN_SEM(i)          do { up(&(i)->i_sem); } while (0)
+#define MDS_DOWN_READ_ORPHAN_SEM(i)        do { down(&(i)->i_sem); } while (0)
+#define LASSERT_MDS_ORPHAN_READ_LOCKED(i)  LASSERT(down_trylock(&(i)->i_sem)!=0)
+
+#define MDS_UP_WRITE_ORPHAN_SEM(i)         do { up(&(i)->i_sem); } while (0)
+#define MDS_DOWN_WRITE_ORPHAN_SEM(i)       do { down(&(i)->i_sem); } while (0)
+#define LASSERT_MDS_ORPHAN_WRITE_LOCKED(i) LASSERT(down_trylock(&(i)->i_sem)!=0)
+#define MDS_PACK_MD_LOCK 0
+#endif
+
 static inline int mds_orphan_open_count(struct inode *inode)
 {
         LASSERT_MDS_ORPHAN_READ_LOCKED(inode);
@@ -63,315 +88,195 @@ static inline int mds_orphan_open_dec_test(struct inode *inode)
 }
 
 #define mds_inode_is_orphan(inode)  ((inode)->i_flags & 0x4000000)
-#define mds_inode_set_orphan(inode)                                     \
-do {                                                                    \
-        (inode)->i_flags |= 0x4000000;                                  \
-        CDEBUG(D_VFSTRACE, "setting orphan flag on inode %p\n", inode); \
-} while (0)
-#define mds_inode_unset_orphan(inode)                                      \
-do {                                                                       \
-        (inode)->i_flags &= ~(0x4000000);                                  \
-        CDEBUG(D_VFSTRACE, "removing orphan flag from inode %p\n", inode); \
-} while (0)
-
-
-/* inode flags managed by mds directly */
-#define MDS_IF_ATTRS_OLD        0x8000000       /* inode needs attrs. refreshing */
-
-#define mds_inode_has_old_attrs(inode)  ((inode)->i_flags & MDS_IF_ATTRS_OLD)
-#define mds_inode_set_attrs_old(inode)                                   \
-do {                                                                     \
-        (inode)->i_flags |= MDS_IF_ATTRS_OLD;                            \
-        CDEBUG(D_VFSTRACE, "setting attr.old flag on inode %p\n", inode);\
-} while (0)
-#define mds_inode_unset_attrs_old(inode)                                     \
-do {                                                                         \
-        (inode)->i_flags &= ~(MDS_IF_ATTRS_OLD);                             \
-        CDEBUG(D_VFSTRACE, "removing attrs.old flag from inode %p\n", inode);\
-} while (0)
 
+static inline void mds_inode_set_orphan(struct inode *inode)
+{
+        inode->i_flags |= 0x4000000;
+        CDEBUG(D_VFSTRACE, "setting orphan flag on inode %p\n", inode);
+}
+
+static inline void mds_inode_unset_orphan(struct inode *inode)
+{
+        inode->i_flags &= ~(0x4000000);
+        CDEBUG(D_VFSTRACE, "removing orphan flag from inode %p\n", inode);
+}
 
 #endif /* __KERNEL__ */
 
+#define MDS_CHECK_RESENT(req, reconstruct)                                    \
+{                                                                             \
+        if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) {              \
+                struct mds_client_data *mcd =                                 \
+                        req->rq_export->exp_mds_data.med_mcd;                 \
+                if (le64_to_cpu(mcd->mcd_last_xid) == req->rq_xid) {          \
+                        reconstruct;                                          \
+                        RETURN(le32_to_cpu(mcd->mcd_last_result));            \
+                }                                                             \
+                if (le64_to_cpu(mcd->mcd_last_close_xid) == req->rq_xid) {    \
+                        reconstruct;                                          \
+                        RETURN(le32_to_cpu(mcd->mcd_last_close_result));      \
+                }                                                             \
+                DEBUG_REQ(D_HA, req, "no reply for RESENT req (have "LPD64")",\
+                          mcd->mcd_last_xid);                                 \
+        }                                                                     \
+}
+
 /* mds/mds_reint.c */
+int res_gt(struct ldlm_res_id *res1, struct ldlm_res_id *res2,
+           ldlm_policy_data_t *p1, ldlm_policy_data_t *p2);
 int enqueue_ordered_locks(struct obd_device *obd, struct ldlm_res_id *p1_res_id,
                           struct lustre_handle *p1_lockh, int p1_lock_mode,
                           ldlm_policy_data_t *p1_policy,
                           struct ldlm_res_id *p2_res_id,
                           struct lustre_handle *p2_lockh, int p2_lock_mode,
                           ldlm_policy_data_t *p2_policy);
-
+void mds_commit_cb(struct obd_device *, __u64 last_rcvd, void *data, int error);
 int mds_finish_transno(struct mds_obd *mds, struct inode *inode, void *handle,
                        struct ptlrpc_request *req, int rc, __u32 op_data);
 void mds_reconstruct_generic(struct ptlrpc_request *req);
 void mds_req_from_mcd(struct ptlrpc_request *req, struct mds_client_data *mcd);
 int mds_get_parent_child_locked(struct obd_device *obd, struct mds_obd *mds,
-                                struct lustre_id *id,
+                                struct ll_fid *fid,
                                 struct lustre_handle *parent_lockh,
                                 struct dentry **dparentp, int parent_mode,
-                                __u64 parent_lockpart, int *update_mode,
+                                __u64 parent_lockpart,
                                 char *name, int namelen,
                                 struct lustre_handle *child_lockh,
                                 struct dentry **dchildp, int child_mode,
                                 __u64 child_lockpart);
 int mds_lock_new_child(struct obd_device *obd, struct inode *inode,
                        struct lustre_handle *child_lockh);
-
+int mds_osc_setattr_async(struct obd_device *obd, struct inode *inode,
+                          struct lov_mds_md *lmm, int lmm_size,
+                          struct llog_cookie *logcookies, struct ll_fid *fid);
+
+int mds_get_parents_children_locked(struct obd_device *obd,
+                                    struct mds_obd *mds,
+                                    struct ll_fid *p1_fid,
+                                    struct dentry **de_srcdirp,
+                                    struct ll_fid *p2_fid,
+                                    struct dentry **de_tgtdirp,
+                                    int parent_mode,
+                                    const char *old_name, int old_len,
+                                    struct dentry **de_oldp,
+                                    const char *new_name, int new_len,
+                                    struct dentry **de_newp,
+                                    struct lustre_handle *dlm_handles,
+                                    int child_mode);
+
+void mds_shrink_reply(struct obd_device *obd, struct ptlrpc_request *req,
+                      struct mds_body *body, int md_off);
+int mds_get_cookie_size(struct obd_device *obd, struct lov_mds_md *lmm);
 /* mds/mds_lib.c */
-void groups_from_buffer(struct group_info *ginfo, __u32 *gids);
 int mds_update_unpack(struct ptlrpc_request *, int offset,
                       struct mds_update_record *);
-int mds_idmap_add(struct mds_idmap_table *tbl,
-                  uid_t rmt_uid, uid_t lcl_uid,
-                  gid_t rmt_gid, gid_t lcl_gid);
-int mds_idmap_del(struct mds_idmap_table *tbl,
-                  uid_t rmt_uid, uid_t lcl_uid,
-                  gid_t rmt_gid, gid_t lcl_gid);
-int mds_idmap_lookup_uid(struct mds_idmap_table *tbl, int reverse, uid_t uid);
-int mds_idmap_lookup_gid(struct mds_idmap_table *tbl, int reverse, gid_t gid);
-struct mds_idmap_table *mds_idmap_alloc(void);
-void mds_idmap_free(struct mds_idmap_table *tbl);
-void mds_body_do_reverse_map(struct mds_export_data *med,
-                             struct mds_body *body);
-int mds_remote_perm_do_reverse_map(struct mds_export_data *med,
-                                   struct mds_remote_perm *perm);
 int mds_init_ucred(struct lvfs_ucred *ucred, struct ptlrpc_request *req,
-                   struct mds_req_sec_desc *rsd);
-void mds_exit_ucred(struct lvfs_ucred *ucred);
-
-int mds_set_gskey(struct obd_device *obd, void *handle, 
-                  struct inode *inode, void *key, int key_len, int valid); 
-int mds_set_crypto_type(struct obd_device *obd, void *val, __u32 vallen);
+                   int offset);
+void mds_exit_ucred(struct lvfs_ucred *ucred, struct mds_obd *obd);
 
-int mds_pack_gskey(struct obd_device *obd, struct lustre_msg *repmsg, 
-                   int *offset, struct mds_body *body, struct inode *inode);
 /* mds/mds_unlink_open.c */
-int mds_cleanup_orphans(struct obd_device *obd);
-
-int mds_unlink_object(struct mds_obd *mds, struct inode *inode,
-                      struct lov_mds_md *lmm, int lmm_size,
-                      struct llog_cookie *logcookies,
-                      int log_unlink, int async);
-        
+int mds_osc_destroy_orphan(struct obd_device *obd, umode_t mode,
+                           struct lov_mds_md *lmm, int lmm_size,
+                           struct llog_cookie *logcookies, int log_unlink);
+int mds_cleanup_pending(struct obd_device *obd);
 
 /* mds/mds_log.c */
-int mds_log_op_unlink(struct obd_device *obd, struct inode *inode,
+int mds_log_op_unlink(struct obd_device *obd,
+                      struct lov_mds_md *lmm, int lmm_size,
+                      struct llog_cookie *logcookies, int cookies_size);
+int mds_log_op_setattr(struct obd_device *obd, struct inode *inode,
                       struct lov_mds_md *lmm, int lmm_size,
-                      struct llog_cookie *logcookies, int cookies_size,
-                      struct llog_create_locks **res);
-int mds_llog_init(struct obd_device *obd, struct obd_llogs *,
-                  struct obd_device *tgt, int count, struct llog_catid *logid);
-int mds_llog_finish(struct obd_device *obd, struct obd_llogs *, int count);
+                      struct llog_cookie *logcookies, int cookies_size);
+int mds_llog_init(struct obd_device *obd, struct obd_device *tgt, int count,
+                  struct llog_catid *logid, struct obd_uuid *uuid);
+int mds_llog_finish(struct obd_device *obd, int count);
 
 /* mds/mds_lov.c */
-int mds_dt_connect(struct obd_device *obd, char * lov_name);
-int mds_dt_disconnect(struct obd_device *obd, int flags);
-int mds_dt_set_info(struct obd_export *exp, obd_count keylen,
-                     void *key, obd_count vallen, void *val);
-int mds_get_lovtgts(struct obd_device *, int tgt_count, struct obd_uuid *);
-int mds_dt_write_objids(struct obd_device *obd);
-int mds_dt_set_growth(struct mds_obd *mds, int count);
-int mds_dt_clear_orphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
+int mds_lov_connect(struct obd_device *obd, char * lov_name);
+int mds_lov_disconnect(struct obd_device *obd);
+int mds_lov_write_objids(struct obd_device *obd);
+void mds_lov_update_objids(struct obd_device *obd, obd_id *ids);
+int mds_lov_clear_orphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
+int mds_lov_set_nextid(struct obd_device *obd);
+int mds_lov_start_synchronize(struct obd_device *obd, 
+                              struct obd_device *watched,
+                              void *data, int nonblock);
 int mds_post_mds_lovconf(struct obd_device *obd);
 int mds_notify(struct obd_device *obd, struct obd_device *watched,
-               int active, void *data);
-int mds_dt_update_config(struct obd_device *obd, int transno);
+               enum obd_notify_event ev, void *data);
 int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
                        struct lov_mds_md *lmm, int lmm_size);
-int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
-                          struct lustre_msg *msg, int offset);
-void mds_dt_update_objids(struct obd_device *obd, obd_id *ids);
-void mds_dt_save_objids(struct obd_device *obd, obd_id *ids);
+void mds_objids_from_lmm(obd_id *ids, struct lov_mds_md *lmm,
+                         struct lov_desc *desc);
+int mds_init_lov_desc(struct obd_device *obd, struct obd_export *osc_exp);
 
 /* mds/mds_open.c */
-int mds_create_object(struct obd_device *obd, struct ptlrpc_request *req,
-                      int offset, struct mds_update_record *rec,
-                      struct dentry *dchild, void **handle,
-                      obd_id *ids);
-int mds_destroy_object(struct obd_device *obd,
-                       struct inode *inode, int async);
 int mds_query_write_access(struct inode *inode);
 int mds_open(struct mds_update_record *rec, int offset,
              struct ptlrpc_request *req, struct lustre_handle *);
 int mds_pin(struct ptlrpc_request *req, int offset);
-int mds_mfd_close(struct ptlrpc_request *req, int offset,
-                  struct obd_device *obd, struct mds_file_data *mfd,
-                  int unlink_orphan);
+void mds_mfd_unlink(struct mds_file_data *mfd, int decref);
+int mds_mfd_close(struct ptlrpc_request *req, int offset,struct obd_device *obd,
+                  struct mds_file_data *mfd, int unlink_orphan,
+                  struct lov_mds_md *lmm, int lmm_size,
+                  struct llog_cookie *logcookies, int cookies_size,
+                  __u64 *valid);
 int mds_close(struct ptlrpc_request *req, int offset);
 int mds_done_writing(struct ptlrpc_request *req, int offset);
-struct mds_file_data *mds_handle2mfd(struct lustre_handle *handle);
-void mds_mfd_put(struct mds_file_data *mfd);
-int mds_validate_size(struct obd_device *obd, struct inode *inode,
-                      struct mds_body *body, struct lov_stripe_md *lsm,
-                      struct iattr *iattr);
-int accmode(int flags);
-
-/* mds/mds_fs.c */
-int mds_fidmap_init(struct obd_device *obd, int size);
-int mds_fidmap_cleanup(struct obd_device *obd);
-
-struct fidmap_entry *
-mds_fidmap_find(struct obd_device *obd, __u64 fid);
 
-struct lustre_id *
-mds_fidmap_lookup(struct obd_device *obd,
-                  struct lustre_id *id);
+/*mds/mds_join.c*/
+int mds_join_file(struct mds_update_record *rec, struct ptlrpc_request *req, 
+                  struct dentry *dchild, struct lustre_handle *lockh);
 
-void mds_fidmap_insert(struct obd_device *obd,
-                       struct fidmap_entry *entry);
-
-void mds_fidmap_remove(struct obd_device *obd,
-                       struct fidmap_entry *entry);
-
-int mds_fidmap_add(struct obd_device *obd,
-                   struct lustre_id *id);
-
-void mds_fidmap_del(struct obd_device *obd,
-                    struct lustre_id *id);
-
-int mds_client_add(struct obd_device *obd, struct mds_obd *mds,
-                   struct mds_export_data *med, int cl_off);
-int mds_client_free(struct obd_export *exp, int clear_client);
+/* mds/mds_fs.c */
+int mds_client_add(struct obd_device *obd, struct obd_export *exp, int cl_off);
+int mds_client_free(struct obd_export *exp);
 int mds_obd_create(struct obd_export *exp, struct obdo *oa,
-                   void *acl, int acl_size,
                    struct lov_stripe_md **ea, struct obd_trans_info *oti);
 int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
-                    struct lov_stripe_md *ea, struct obd_trans_info *oti);
+                    struct lov_stripe_md *ea, struct obd_trans_info *oti,
+                    struct obd_export *md_exp);
 
 /* mds/handler.c */
-int mds_getattr_size(struct obd_device *obd, struct dentry *dentry,
-                     struct ptlrpc_request *req, struct mds_body *body);
-int mds_handle(struct ptlrpc_request *req);
 extern struct lvfs_callback_ops mds_lvfs_ops;
-int mds_dt_clean(struct obd_device *obd);
+extern int mds_iocontrol(unsigned int cmd, struct obd_export *exp,
+                         int len, void *karg, void *uarg);
 int mds_postrecov(struct obd_device *obd);
-int mds_postrecov_common(struct obd_device *obd);
-extern struct lvfs_callback_ops mds_lvfs_ops;
-
-extern int mds_iocontrol(unsigned int cmd,
-                         struct obd_export *exp,
-                         int len, void *karg,
-                         void *uarg);
-
-extern int mds_lock_mode_for_dir(struct obd_device *,
-                                 struct dentry *, int);
-
-int mds_fs_setup_rootid(struct obd_device *obd);
-int mds_fs_setup_virtid(struct obd_device *obd);
-
-__u64 mds_alloc_fid(struct obd_device *obd);
-
-void mds_inode2id(struct obd_device *obd, struct lustre_id *id,
-                  struct inode *inode, __u64 fid);
-int mds_update_inode_ids(struct obd_device *, struct inode *,
-                         void *, struct lustre_id *, struct lustre_id *);
-int mds_read_inode_sid(struct obd_device *, struct inode *,
-                       struct lustre_id *);
-
-int mds_read_inode_pid(struct obd_device *, struct inode *,
-                       struct lustre_id *);
-
-void mds_commit_last_fid_cb(struct obd_device *, __u64 fid,
-                            void *data, int error);
-
-void mds_commit_last_transno_cb(struct obd_device *, __u64 transno,
-                                void *data, int error);
-
-void mds_set_last_fid(struct obd_device *obd, __u64 fid);
-
+int mds_init_export(struct obd_export *exp);
 #ifdef __KERNEL__
-int mds_get_md(struct obd_device *, struct inode *, void *md,
-               int *size, int lock, int mea);
-
+int mds_get_md(struct obd_device *, struct inode *, void *md, int *size,
+               int lock);
 int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset,
-                struct mds_body *, struct inode *, int lock, int mea);
-int mds_pack_link(struct dentry *dentry, struct ptlrpc_request *req,
-                  struct mds_body *repbody, int reply_off);
-int mds_pack_xattr(struct dentry *dentry, struct ptlrpc_request *req,
-                   struct mds_body *repbody, int req_off, int reply_off);
-int mds_pack_xattr_list(struct dentry *dentry, struct ptlrpc_request *req,
-                        struct mds_body *repbody, int reply_off);
-int mds_pack_acl(struct ptlrpc_request *req, int reply_off,
-                 struct mds_body *body, struct inode *inode);
-
-int mds_pack_inode2id(struct obd_device *, struct lustre_id *,
-                      struct inode *, int);
-
-void mds_pack_inode2body(struct obd_device *, struct mds_body *,
-                         struct inode *, int);
-
-void mds_pack_dentry2id(struct obd_device *, struct lustre_id *,
-                        struct dentry *, int);
-
-void mds_pack_dentry2body(struct obd_device *, struct mds_body *b,
-                          struct dentry *, int);
-
+                struct mds_body *, struct inode *, int lock);
+void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode);
+void mds_pack_inode2body(struct mds_body *body, struct inode *inode);
 #endif
-
-/* mds/mds_lmv.c */
-int mds_md_postsetup(struct obd_device *obd);
-int mds_md_connect(struct obd_device *obd, char * lov_name);
-int mds_md_disconnect(struct obd_device *obd, int flags);
-int mds_try_to_split_dir(struct obd_device *, struct dentry *, struct mea **,
-                         int, int);
-int mds_md_get_attr(struct obd_device *, struct inode *, struct mea **, int *);
-int mds_choose_mdsnum(struct obd_device *, const char *, int, int,
-                      struct ptlrpc_peer *, struct inode *, int);
-int mds_md_postsetup(struct obd_device *);
-int mds_splitting_expected(struct obd_device *, struct dentry *);
-int mds_lock_slave_objs(struct obd_device *, struct dentry *,
-                        struct lustre_handle **);
-int mds_unlink_slave_objs(struct obd_device *, struct dentry *);
-void mds_unlock_slave_objs(struct obd_device *, struct dentry *,
-                           struct lustre_handle *);
-int mds_lock_and_check_slave(int, struct ptlrpc_request *, struct lustre_handle *);
-int mds_convert_mea_ea(struct obd_device *, struct inode *, struct lov_mds_md *, int);
-int mds_is_dir_empty(struct obd_device *, struct dentry *);
-int mds_md_reconnect(struct obd_device *obd);
-
-/* mds_lsd.c */
-struct upcall_cache *__mds_get_global_lsd_cache(void);
-int mds_init_lsd_cache(void);
-void mds_cleanup_lsd_cache(void);
-struct lustre_sec_desc * mds_get_lsd(__u32 uid);
-void mds_put_lsd(struct lustre_sec_desc *lsd);
-void mds_flush_lsd(__u32 id);
-
-/* mds_audit_path.c */
-int mds_parse_id(struct ptlrpc_request *req);
-
-/* mds_audit.c */
-int mds_set_audit(struct obd_device * obd, void * val);
-int mds_pack_audit(struct obd_device *, struct inode *, struct mds_body *);
-int mds_audit_auth(struct ptlrpc_request *, struct lvfs_ucred *,
-                   audit_op, struct lustre_id *, char *, int);
-int mds_audit_stat(struct ptlrpc_request *, struct lustre_id *,
-                   struct inode *, char*, int, int);
-int mds_audit_open(struct ptlrpc_request *, struct lustre_id *,
-                   struct inode *, char*, int, int);
-int mds_audit_reint(struct ptlrpc_request *, struct mds_update_record *);
-int mds_audit(struct ptlrpc_request *, struct dentry *, char *, 
-              int, audit_op, int);
-/* mds_acl.c */
-struct upcall_cache *__mds_get_global_rmtacl_upcall_cache(void);
-int mds_init_rmtacl_upcall_cache(void);
-void mds_cleanup_rmtacl_upcall_cache(void);
-void mds_do_remote_acl_upcall(struct rmtacl_upcall_desc *desc);
-
-/* mds_capa.c */
-extern struct timer_list mds_eck_timer;
-
-int mds_read_capa_key(struct obd_device *obd, struct file *file);
-void mds_capa_keys_cleanup(struct obd_device *obd);
-void mds_capa_key_timer_callback(unsigned long data);
-int mds_capa_key_start_thread(void);
-void mds_capa_key_stop_thread(void);
-int mds_pack_capa(struct obd_device *obd, struct mds_export_data *med, 
-                  struct mds_body *req_body, struct lustre_capa *req_capa,
-                  struct ptlrpc_request *req, int *offset, 
-                  struct mds_body *body);
-void mds_update_capa_stat(struct obd_device *obd, int stat);
-void mds_update_capa_timeout(struct obd_device *obd, unsigned long timeout);
-int mds_update_capa_key_timeout(struct obd_device *obd, unsigned long timeout);
+int mds_pack_acl(struct mds_export_data *med, struct inode *inode,
+                 struct lustre_msg *repmsg, struct mds_body *repbody,
+                 int repoff);
+
+/* quota stuff */
+extern quota_interface_t *mds_quota_interface_ref;
+
+/* mds/mds_xattr.c */
+int mds_setxattr(struct ptlrpc_request *req);
+int mds_getxattr(struct ptlrpc_request *req);
+
+/* mds/lproc_mds.c */
+enum {
+        LPROC_MDS_OPEN = 0,
+        LPROC_MDS_CLOSE,
+        LPROC_MDS_MKNOD,
+        LPROC_MDS_LINK,
+        LPROC_MDS_UNLINK,
+        LPROC_MDS_MKDIR,
+        LPROC_MDS_RMDIR,
+        LPROC_MDS_RENAME,
+        LPROC_MDS_GETXATTR,
+        LPROC_MDS_SETXATTR,
+        LPROC_MDS_LAST,
+};
+void mds_counter_incr(struct obd_export *exp, int opcode);
+void mds_stats_counter_init(struct lprocfs_stats *stats);
 
 #endif /* _MDS_INTERNAL_H */