* Lustre is a trademark of Sun Microsystems, Inc.
*/
-#define MAX_STRING_SIZE 128
-
extern int ldlm_srv_namespace_nr;
extern int ldlm_cli_namespace_nr;
extern struct mutex ldlm_srv_namespace_lock;
/* ldlm_resource.c */
extern struct kmem_cache *ldlm_resource_slab;
extern struct kmem_cache *ldlm_lock_slab;
+extern struct kmem_cache *ldlm_inodebits_slab;
extern struct kmem_cache *ldlm_interval_tree_slab;
void ldlm_resource_insert_lock_after(struct ldlm_lock *original,
#ifdef HAVE_SERVER_SUPPORT
int ldlm_reprocess_queue(struct ldlm_resource *res, struct list_head *queue,
struct list_head *work_list,
- enum ldlm_process_intention intention);
+ enum ldlm_process_intention intention,
+ struct ldlm_lock *hint);
int ldlm_handle_conflict_lock(struct ldlm_lock *lock, __u64 *flags,
struct list_head *rpc_list);
void ldlm_discard_bl_list(struct list_head *bl_list);
enum ldlm_process_intention intention,
enum ldlm_error *err,
struct list_head *work_list);
+int ldlm_reprocess_inodebits_queue(struct ldlm_resource *res,
+ struct list_head *queue,
+ struct list_head *work_list,
+ enum ldlm_process_intention intention,
+ struct ldlm_lock *hint);
/* ldlm_extent.c */
int ldlm_process_extent_lock(struct ldlm_lock *lock, __u64 *flags,
enum ldlm_process_intention intention,
enum ldlm_error *err, struct list_head *work_list);
#endif
+int ldlm_extent_alloc_lock(struct ldlm_lock *lock);
void ldlm_extent_add_lock(struct ldlm_resource *res, struct ldlm_lock *lock);
void ldlm_extent_unlink_lock(struct ldlm_lock *lock);
+int ldlm_inodebits_alloc_lock(struct ldlm_lock *lock);
+void ldlm_inodebits_add_lock(struct ldlm_resource *res, struct list_head *head,
+ struct ldlm_lock *lock);
+void ldlm_inodebits_unlink_lock(struct ldlm_lock *lock);
+
/* ldlm_flock.c */
int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
enum ldlm_process_intention intention,
extern struct kmem_cache *ldlm_interval_slab; /* slab cache for ldlm_interval */
extern void ldlm_interval_attach(struct ldlm_interval *n, struct ldlm_lock *l);
extern struct ldlm_interval *ldlm_interval_detach(struct ldlm_lock *l);
-extern struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock);
extern void ldlm_interval_free(struct ldlm_interval *node);
/* this function must be called with res lock held */
static inline struct ldlm_extent *
static ssize_t var##_store(struct kobject *kobj, \
struct attribute *attr, \
const char *buffer, \
- unsigned long count) \
+ size_t count) \
{ \
struct ldlm_pool *pl = container_of(kobj, struct ldlm_pool,\
pl_kobj); \
static ssize_t var##_store(struct kobject *kobj, \
struct attribute *attr, \
const char *buffer, \
- unsigned long count) \
+ size_t count) \
{ \
struct ldlm_pool *pl = container_of(kobj, struct ldlm_pool,\
pl_kobj); \
ldlm_add_var(struct lprocfs_vars *vars, struct dentry *debugfs_entry,
const char *name, void *data, const struct file_operations *ops)
{
- snprintf((char *)vars->name, MAX_STRING_SIZE, "%s", name);
+ vars->name = name;
vars->data = data;
vars->fops = ops;
ldebugfs_add_vars(debugfs_entry, vars, NULL);
static inline int is_granted_or_cancelled(struct ldlm_lock *lock)
{
- int ret = 0;
+ int ret = 0;
- lock_res_and_lock(lock);
- if ((lock->l_req_mode == lock->l_granted_mode) &&
- !ldlm_is_cp_reqd(lock))
- ret = 1;
- else if (ldlm_is_failed(lock) || ldlm_is_cancel(lock))
- ret = 1;
- unlock_res_and_lock(lock);
+ lock_res_and_lock(lock);
+ ret = is_granted_or_cancelled_nolock(lock);
+ unlock_res_and_lock(lock);
- return ret;
+ return ret;
}
static inline bool is_bl_done(struct ldlm_lock *lock)