Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
dlmglue.c File Reference
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/mm.h>
#include <linux/kthread.h>
#include <linux/pagemap.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/time.h>
#include <linux/quotaops.h>
#include <cluster/masklog.h>
#include "ocfs2.h"
#include "ocfs2_lockingver.h"
#include "alloc.h"
#include "dcache.h"
#include "dlmglue.h"
#include "extent_map.h"
#include "file.h"
#include "heartbeat.h"
#include "inode.h"
#include "journal.h"
#include "stackglue.h"
#include "slot_map.h"
#include "super.h"
#include "uptodate.h"
#include "quota.h"
#include "refcounttree.h"
#include "buffer_head_io.h"

Go to the source code of this file.

Data Structures

struct  ocfs2_mask_waiter
 
struct  ocfs2_unblock_ctl
 
struct  ocfs2_lock_res_ops
 
struct  ocfs2_dlm_seq_priv
 

Macros

#define MLOG_MASK_PREFIX   ML_DLM_GLUE
 
#define mlog_meta_lvb(__level, __lockres)   ocfs2_dump_meta_lvb_info(__level, __PRETTY_FUNCTION__, __LINE__, __lockres)
 
#define LOCK_TYPE_REQUIRES_REFRESH   0x1
 
#define LOCK_TYPE_USES_LVB   0x2
 
#define ocfs2_log_dlm_error(_func, _err, _lockres)
 
#define OCFS2_SEC_BITS   34
 
#define OCFS2_SEC_SHIFT   (64 - 34)
 
#define OCFS2_NSEC_MASK   ((1ULL << OCFS2_SEC_SHIFT) - 1)
 
#define OCFS2_DLM_DEBUG_STR_VERSION   3
 
#define lock_num_prmode(_l)   (0)
 
#define lock_num_exmode(_l)   (0)
 
#define lock_num_prmode_failed(_l)   (0)
 
#define lock_num_exmode_failed(_l)   (0)
 
#define lock_total_prmode(_l)   (0ULL)
 
#define lock_total_exmode(_l)   (0ULL)
 
#define lock_max_prmode(_l)   (0)
 
#define lock_max_exmode(_l)   (0)
 
#define lock_refresh(_l)   (0)
 

Enumerations

enum  ocfs2_unblock_action { UNBLOCK_CONTINUE = 0, UNBLOCK_CONTINUE_POST = 1, UNBLOCK_STOP_POST = 2 }
 

Functions

void ocfs2_lock_res_init_once (struct ocfs2_lock_res *res)
 
void ocfs2_inode_lock_res_init (struct ocfs2_lock_res *res, enum ocfs2_lock_type type, unsigned int generation, struct inode *inode)
 
void ocfs2_dentry_lock_res_init (struct ocfs2_dentry_lock *dl, u64 parent, struct inode *inode)
 
void ocfs2_file_lock_res_init (struct ocfs2_lock_res *lockres, struct ocfs2_file_private *fp)
 
void ocfs2_qinfo_lock_res_init (struct ocfs2_lock_res *lockres, struct ocfs2_mem_dqinfo *info)
 
void ocfs2_refcount_lock_res_init (struct ocfs2_lock_res *lockres, struct ocfs2_super *osb, u64 ref_blkno, unsigned int generation)
 
void ocfs2_lock_res_free (struct ocfs2_lock_res *res)
 
void ocfs2_set_locking_protocol (void)
 
int ocfs2_create_new_inode_locks (struct inode *inode)
 
int ocfs2_rw_lock (struct inode *inode, int write)
 
void ocfs2_rw_unlock (struct inode *inode, int write)
 
int ocfs2_open_lock (struct inode *inode)
 
int ocfs2_try_open_lock (struct inode *inode, int write)
 
void ocfs2_open_unlock (struct inode *inode)
 
int ocfs2_file_lock (struct file *file, int ex, int trylock)
 
void ocfs2_file_unlock (struct file *file)
 
int ocfs2_inode_lock_full_nested (struct inode *inode, struct buffer_head **ret_bh, int ex, int arg_flags, int subclass)
 
int ocfs2_inode_lock_with_page (struct inode *inode, struct buffer_head **ret_bh, int ex, struct page *page)
 
int ocfs2_inode_lock_atime (struct inode *inode, struct vfsmount *vfsmnt, int *level)
 
void ocfs2_inode_unlock (struct inode *inode, int ex)
 
int ocfs2_orphan_scan_lock (struct ocfs2_super *osb, u32 *seqno)
 
void ocfs2_orphan_scan_unlock (struct ocfs2_super *osb, u32 seqno)
 
int ocfs2_super_lock (struct ocfs2_super *osb, int ex)
 
void ocfs2_super_unlock (struct ocfs2_super *osb, int ex)
 
int ocfs2_rename_lock (struct ocfs2_super *osb)
 
void ocfs2_rename_unlock (struct ocfs2_super *osb)
 
int ocfs2_nfs_sync_lock (struct ocfs2_super *osb, int ex)
 
void ocfs2_nfs_sync_unlock (struct ocfs2_super *osb, int ex)
 
int ocfs2_dentry_lock (struct dentry *dentry, int ex)
 
void ocfs2_dentry_unlock (struct dentry *dentry, int ex)
 
void ocfs2_put_dlm_debug (struct ocfs2_dlm_debug *dlm_debug)
 
struct ocfs2_dlm_debugocfs2_new_dlm_debug (void)
 
int ocfs2_dlm_init (struct ocfs2_super *osb)
 
void ocfs2_dlm_shutdown (struct ocfs2_super *osb, int hangup_pending)
 
void ocfs2_mark_lockres_freeing (struct ocfs2_lock_res *lockres)
 
void ocfs2_simple_drop_lockres (struct ocfs2_super *osb, struct ocfs2_lock_res *lockres)
 
int ocfs2_drop_inode_locks (struct inode *inode)
 
void ocfs2_qinfo_unlock (struct ocfs2_mem_dqinfo *oinfo, int ex)
 
int ocfs2_qinfo_lock (struct ocfs2_mem_dqinfo *oinfo, int ex)
 
int ocfs2_refcount_lock (struct ocfs2_refcount_tree *ref_tree, int ex)
 
void ocfs2_refcount_unlock (struct ocfs2_refcount_tree *ref_tree, int ex)
 
void ocfs2_wake_downconvert_thread (struct ocfs2_super *osb)
 

Variables

struct lock_class_key lockdep_keys [OCFS2_NUM_LOCK_TYPES]
 

Macro Definition Documentation

#define lock_max_exmode (   _l)    (0)
#define lock_max_prmode (   _l)    (0)
#define lock_num_exmode (   _l)    (0)
#define lock_num_exmode_failed (   _l)    (0)
#define lock_num_prmode (   _l)    (0)
#define lock_num_prmode_failed (   _l)    (0)
#define lock_refresh (   _l)    (0)
#define lock_total_exmode (   _l)    (0ULL)
#define lock_total_prmode (   _l)    (0ULL)
#define LOCK_TYPE_REQUIRES_REFRESH   0x1

Definition at line 227 of file dlmglue.c.

#define LOCK_TYPE_USES_LVB   0x2

Definition at line 233 of file dlmglue.c.

#define MLOG_MASK_PREFIX   ML_DLM_GLUE

Definition at line 37 of file dlmglue.c.

#define mlog_meta_lvb (   __level,
  __lockres 
)    ocfs2_dump_meta_lvb_info(__level, __PRETTY_FUNCTION__, __LINE__, __lockres)

Definition at line 119 of file dlmglue.c.

#define OCFS2_DLM_DEBUG_STR_VERSION   3

Definition at line 2790 of file dlmglue.c.

#define ocfs2_log_dlm_error (   _func,
  _err,
  _lockres 
)
Value:
do { \
if ((_lockres)->l_type != OCFS2_LOCK_TYPE_DENTRY) \
mlog(ML_ERROR, "DLM error %d while calling %s on resource %s\n", \
_err, _func, _lockres->l_name); \
mlog(ML_ERROR, "DLM error %d while calling %s on resource %.*s%08x\n", \
_err, _func, OCFS2_DENTRY_LOCK_INO_START - 1, (_lockres)->l_name, \
(unsigned int)ocfs2_get_dentry_lock_ino(_lockres)); \
} while (0)

Definition at line 364 of file dlmglue.c.

#define OCFS2_NSEC_MASK   ((1ULL << OCFS2_SEC_SHIFT) - 1)

Definition at line 2009 of file dlmglue.c.

#define OCFS2_SEC_BITS   34

Definition at line 2007 of file dlmglue.c.

#define OCFS2_SEC_SHIFT   (64 - 34)

Definition at line 2008 of file dlmglue.c.

Enumeration Type Documentation

Enumerator:
UNBLOCK_CONTINUE 
UNBLOCK_CONTINUE_POST 
UNBLOCK_STOP_POST 

Definition at line 83 of file dlmglue.c.

Function Documentation

int ocfs2_create_new_inode_locks ( struct inode inode)

Definition at line 1596 of file dlmglue.c.

int ocfs2_dentry_lock ( struct dentry dentry,
int  ex 
)

Definition at line 2628 of file dlmglue.c.

void ocfs2_dentry_lock_res_init ( struct ocfs2_dentry_lock dl,
u64  parent,
struct inode inode 
)

Definition at line 602 of file dlmglue.c.

void ocfs2_dentry_unlock ( struct dentry dentry,
int  ex 
)

Definition at line 2653 of file dlmglue.c.

int ocfs2_dlm_init ( struct ocfs2_super osb)

Definition at line 2969 of file dlmglue.c.

void ocfs2_dlm_shutdown ( struct ocfs2_super osb,
int  hangup_pending 
)

Definition at line 3033 of file dlmglue.c.

int ocfs2_drop_inode_locks ( struct inode inode)

Definition at line 3192 of file dlmglue.c.

int ocfs2_file_lock ( struct file file,
int  ex,
int  trylock 
)

Definition at line 1840 of file dlmglue.c.

void ocfs2_file_lock_res_init ( struct ocfs2_lock_res lockres,
struct ocfs2_file_private fp 
)

Definition at line 685 of file dlmglue.c.

void ocfs2_file_unlock ( struct file file)

Definition at line 1936 of file dlmglue.c.

int ocfs2_inode_lock_atime ( struct inode inode,
struct vfsmount vfsmnt,
int level 
)

Definition at line 2430 of file dlmglue.c.

int ocfs2_inode_lock_full_nested ( struct inode inode,
struct buffer_head **  ret_bh,
int  ex,
int  arg_flags,
int  subclass 
)

Definition at line 2282 of file dlmglue.c.

void ocfs2_inode_lock_res_init ( struct ocfs2_lock_res res,
enum ocfs2_lock_type  type,
unsigned int  generation,
struct inode inode 
)

Definition at line 536 of file dlmglue.c.

int ocfs2_inode_lock_with_page ( struct inode inode,
struct buffer_head **  ret_bh,
int  ex,
struct page page 
)

Definition at line 2412 of file dlmglue.c.

void ocfs2_inode_unlock ( struct inode inode,
int  ex 
)

Definition at line 2466 of file dlmglue.c.

void ocfs2_lock_res_free ( struct ocfs2_lock_res res)

Definition at line 722 of file dlmglue.c.

void ocfs2_lock_res_init_once ( struct ocfs2_lock_res res)

Definition at line 526 of file dlmglue.c.

void ocfs2_mark_lockres_freeing ( struct ocfs2_lock_res lockres)

Definition at line 3148 of file dlmglue.c.

struct ocfs2_dlm_debug* ocfs2_new_dlm_debug ( void  )
read

Definition at line 2686 of file dlmglue.c.

int ocfs2_nfs_sync_lock ( struct ocfs2_super osb,
int  ex 
)

Definition at line 2600 of file dlmglue.c.

void ocfs2_nfs_sync_unlock ( struct ocfs2_super osb,
int  ex 
)

Definition at line 2619 of file dlmglue.c.

int ocfs2_open_lock ( struct inode inode)

Definition at line 1684 of file dlmglue.c.

void ocfs2_open_unlock ( struct inode inode)

Definition at line 1750 of file dlmglue.c.

int ocfs2_orphan_scan_lock ( struct ocfs2_super osb,
u32 seqno 
)

Definition at line 2482 of file dlmglue.c.

void ocfs2_orphan_scan_unlock ( struct ocfs2_super osb,
u32  seqno 
)

Definition at line 2509 of file dlmglue.c.

void ocfs2_put_dlm_debug ( struct ocfs2_dlm_debug dlm_debug)

Definition at line 2675 of file dlmglue.c.

int ocfs2_qinfo_lock ( struct ocfs2_mem_dqinfo oinfo,
int  ex 
)

Definition at line 3823 of file dlmglue.c.

void ocfs2_qinfo_lock_res_init ( struct ocfs2_lock_res lockres,
struct ocfs2_mem_dqinfo info 
)

Definition at line 700 of file dlmglue.c.

void ocfs2_qinfo_unlock ( struct ocfs2_mem_dqinfo oinfo,
int  ex 
)

Definition at line 3768 of file dlmglue.c.

int ocfs2_refcount_lock ( struct ocfs2_refcount_tree ref_tree,
int  ex 
)

Definition at line 3855 of file dlmglue.c.

void ocfs2_refcount_lock_res_init ( struct ocfs2_lock_res lockres,
struct ocfs2_super osb,
u64  ref_blkno,
unsigned int  generation 
)

Definition at line 711 of file dlmglue.c.

void ocfs2_refcount_unlock ( struct ocfs2_refcount_tree ref_tree,
int  ex 
)

Definition at line 3876 of file dlmglue.c.

int ocfs2_rename_lock ( struct ocfs2_super osb)

Definition at line 2574 of file dlmglue.c.

void ocfs2_rename_unlock ( struct ocfs2_super osb)

Definition at line 2592 of file dlmglue.c.

int ocfs2_rw_lock ( struct inode inode,
int  write 
)

Definition at line 1640 of file dlmglue.c.

void ocfs2_rw_unlock ( struct inode inode,
int  write 
)

Definition at line 1667 of file dlmglue.c.

void ocfs2_set_locking_protocol ( void  )

Definition at line 1189 of file dlmglue.c.

void ocfs2_simple_drop_lockres ( struct ocfs2_super osb,
struct ocfs2_lock_res lockres 
)

Definition at line 3173 of file dlmglue.c.

int ocfs2_super_lock ( struct ocfs2_super osb,
int  ex 
)

Definition at line 2523 of file dlmglue.c.

void ocfs2_super_unlock ( struct ocfs2_super osb,
int  ex 
)

Definition at line 2564 of file dlmglue.c.

int ocfs2_try_open_lock ( struct inode inode,
int  write 
)

Definition at line 1709 of file dlmglue.c.

void ocfs2_wake_downconvert_thread ( struct ocfs2_super osb)

Definition at line 4039 of file dlmglue.c.

Variable Documentation

Definition at line 97 of file dlmglue.c.