Whamcloud - gitweb
- landed b_hd_mdref (mostly WB cache fixes)
[fs/lustre-release.git] / lustre / mds / mds_internal.h
index 167f674..f707e98 100644 (file)
@@ -23,6 +23,9 @@ struct mds_filter_data {
 #define MDS_EXPECT_SPLIT        1
 #define MDS_NO_SPLITTABLE       2
 
+/* 1048576 should be enough for one client pool */
+#define MDS_FIDEXT_SIZE (1 << 20)
+
 static inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req)
 {
         return &req->rq_export->exp_obd->u.mds;
@@ -69,6 +72,24 @@ 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)
+
+
 #endif /* __KERNEL__ */
 
 /* mds/mds_reint.c */
@@ -115,6 +136,12 @@ 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 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);
 
@@ -154,11 +181,10 @@ void mds_dt_update_objids(struct obd_device *obd, obd_id *ids);
 void mds_dt_save_objids(struct obd_device *obd, obd_id *ids);
 
 /* 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_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);
@@ -170,9 +196,32 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,
                   int unlink_orphan);
 int mds_close(struct ptlrpc_request *req, int offset);
 int mds_done_writing(struct ptlrpc_request *req, int offset);
-
+int mds_validate_size(struct obd_device *obd, struct inode *inode,
+                      struct mds_body *body, struct iattr *iattr);
 
 /* 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);
+
+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);
@@ -185,8 +234,6 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
 /* mds/handler.c */
 int mds_getattr_size(struct obd_device *obd, struct dentry *dentry,
                      struct ptlrpc_request *req, struct mds_body *body);
-int mds_squash_root(struct mds_obd *mds, struct mds_req_sec_desc *rsd,
-                    ptl_nid_t *peernid);
 int mds_handle(struct ptlrpc_request *req);
 extern struct lvfs_callback_ops mds_lvfs_ops;
 int mds_dt_clean(struct obd_device *obd);
@@ -207,19 +254,14 @@ int mds_fs_setup_virtid(struct obd_device *obd);
 
 __u64 mds_alloc_fid(struct obd_device *obd);
 
-int mds_alloc_inode_sid(struct obd_device *, struct inode *,
-                        void *, struct lustre_id *);
-
-int mds_update_inode_sid(struct obd_device *, struct inode *,
-                         void *, struct lustre_id *);
-
+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_update_inode_mid(struct obd_device *, struct inode *,
-                         void *, struct lustre_id *);
-
-int mds_read_inode_mid(struct obd_device *, struct inode *,
+int mds_read_inode_pid(struct obd_device *, struct inode *,
                        struct lustre_id *);
 
 void mds_commit_last_fid_cb(struct obd_device *, __u64 fid,
@@ -238,12 +280,13 @@ 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_ea(struct dentry *dentry, struct ptlrpc_request *req,
-                struct mds_body *repbody, int req_off, int reply_off);
-int mds_pack_ealist(struct dentry *dentry, struct ptlrpc_request *req,
-                    struct mds_body *repbody, int reply_off);
-int mds_pack_acl(struct obd_device *, struct lustre_msg *, int offset,
-                 struct mds_body *, struct inode *);
+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);
 
@@ -255,6 +298,7 @@ void mds_pack_dentry2id(struct obd_device *, struct lustre_id *,
 
 void mds_pack_dentry2body(struct obd_device *, struct mds_body *b,
                           struct dentry *, int);
+
 #endif
 
 /* mds/mds_lmv.c */
@@ -264,7 +308,8 @@ 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 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 *,
@@ -285,4 +330,17 @@ 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 *);
+
+/* 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);
+
 #endif /* _MDS_INTERNAL_H */