Whamcloud - gitweb
LU-3531 llite: move dir cache to MDC layer
[fs/lustre-release.git] / lustre / mdc / mdc_internal.h
index badbc47..cc2816b 100644 (file)
 #include <lustre_mds.h>
 
 #ifdef LPROCFS
-void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
-#else
-static inline void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
-{
-        memset(lvars, 0, sizeof(*lvars));
-}
+extern struct lprocfs_seq_vars lprocfs_mdc_obd_vars[];
 #endif
 
 void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
@@ -69,9 +64,10 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
                      const void *data, int datalen, __u32 mode, __u32 uid,
                      __u32 gid, cfs_cap_t capability, __u64 rdev);
 void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
-                   __u32 mode, __u64 rdev, __u32 flags, const void *data,
-                   int datalen);
+                  __u32 mode, __u64 rdev, __u64 flags, const void *data,
+                  int datalen);
 void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data);
+void mdc_getxattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data);
 void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data);
 void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
                      const char *old, int oldlen, const char *new, int newlen);
@@ -100,7 +96,7 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
                 struct lustre_handle *lockh, void *lmm, int lmmsize,
                struct ptlrpc_request **req, __u64 extra_lock_flags);
 
-int mdc_resource_get_unused(struct obd_export *exp, struct lu_fid *fid,
+int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
                             cfs_list_t *cancels, ldlm_mode_t mode,
                             __u64 bits);
 /* mdc/mdc_request.c */
@@ -120,8 +116,8 @@ int mdc_get_lustre_md(struct obd_export *md_exp, struct ptlrpc_request *req,
 int mdc_free_lustre_md(struct obd_export *exp, struct lustre_md *md);
 
 int mdc_set_open_replay_data(struct obd_export *exp,
-                             struct obd_client_handle *och,
-                             struct ptlrpc_request *open_req);
+                            struct obd_client_handle *och,
+                            struct lookup_intent *it);
 
 int mdc_clear_open_replay_data(struct obd_export *exp,
                                struct obd_client_handle *och);
@@ -177,4 +173,17 @@ static inline int mdc_prep_elc_req(struct obd_export *exp,
                                 count);
 }
 
+static inline unsigned long hash_x_index(__u64 hash, int hash64)
+{
+#ifdef __KERNEL__
+       if (BITS_PER_LONG == 32 && hash64)
+               hash >>= 32;
+#endif
+       /* save hash 0 as index 0 because otherwise we'll save it at
+        * page index end (~0UL) and it causes truncate_inode_pages_range()
+        * to loop forever.
+        */
+       return ~0UL - (hash + !hash);
+}
+
 #endif