Whamcloud - gitweb
The old patch was failing because sometimes the inodes were gone by the time
[fs/lustre-release.git] / lustre / include / linux / lustre_dlm.h
index 86f339d..9f6c747 100644 (file)
@@ -38,6 +38,10 @@ typedef enum {
 #define LDLM_FL_AST_SENT       (1 << 5)
 #define LDLM_FL_DESTROYED      (1 << 6)
 #define LDLM_FL_WAIT_NOREPROC  (1 << 7)
+#define LDLM_FL_CANCEL         (1 << 8)
+
+#define LDLM_CB_BLOCKING    1
+#define LDLM_CB_CANCELING   2
 
 #define L2B(c) (1 << c)
 
@@ -92,6 +96,10 @@ struct ldlm_namespace {
         struct lustre_lock     ns_lock; /* protects hash, refcount, list */
         struct list_head       ns_list_chain; /* position in global NS list */
         struct proc_dir_entry *ns_proc_dir;
+
+        spinlock_t             ns_counter_lock;
+        __u64                  ns_locks;
+        __u64                  ns_resources;
 };
 
 /* 
@@ -108,7 +116,7 @@ struct ldlm_lock;
 
 typedef int (*ldlm_blocking_callback)(struct ldlm_lock *lock,
                                       struct ldlm_lock_desc *new, void *data,
-                                      __u32 data_len);
+                                      __u32 data_len, int flag);
 
 typedef int (*ldlm_completion_callback)(struct ldlm_lock *lock, int flags); 
 
@@ -255,6 +263,7 @@ void ldlm_unregister_intent(void);
 void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh);
 struct ldlm_lock *ldlm_handle2lock(struct lustre_handle *handle);
 void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh);
+void ldlm_cancel_callback(struct ldlm_lock *lock);
 
 #define LDLM_LOCK_PUT(lock)                     \
 do {                                            \
@@ -361,12 +370,12 @@ int ldlm_server_ast(struct lustre_handle *lockh, struct ldlm_lock_desc *new,
                     void *data, __u32 data_len);
 int ldlm_cli_convert(struct lustre_handle *, int new_mode, int *flags);
 int ldlm_cli_cancel(struct lustre_handle *lockh);
-int ldlm_cli_cancel_unused(struct ldlm_namespace *ns, __u64 *res_id);
+int ldlm_cli_cancel_unused(struct ldlm_namespace *, __u64 *, int local_only);
 
 /* mds/handler.c */
 /* This has to be here because recurisve inclusion sucks. */
 int mds_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
-                     void *data, __u32 data_len);
+                     void *data, __u32 data_len, int flag);
 
 #endif /* __KERNEL__ */