aboutsummaryrefslogtreecommitdiff
path: root/fs/dlm/dlm_internal.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 09:33:02 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 09:33:02 -0800
commitb5eb9513f7c1bee862ada22bf1489f53752686bd (patch)
tree707404a45b1ca8809fa8607c5d9d96ca9c657db7 /fs/dlm/dlm_internal.h
parentdde0013782dbd09e1cc68ca03860f3a62b03cb34 (diff)
parent30727174b6273c67fa96fb818fe5bdde1ad70e5c (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm: dlm: add __init and __exit marks to init and exit functions dlm: eliminate astparam type casting dlm: proper types for asts and basts dlm: dlm/user.c input validation fixes dlm: fix dlm_dir_lookup() handling of too long names dlm: fix overflows when copying from ->m_extra to lvb dlm: make find_rsb() fail gracefully when namelen is too large dlm: receive_rcom_lock_args() overflow check dlm: verify that places expecting rcom_lock have packet long enough dlm: validate data in dlm_recover_directory() dlm: missing length check in check_config() dlm: use proper type for ->ls_recover_buf dlm: do not byteswap rcom_config dlm: do not byteswap rcom_lock dlm: dlm_process_incoming_buffer() fixes dlm: use proper C for dlm/requestqueue stuff (and fix alignment bug)
Diffstat (limited to 'fs/dlm/dlm_internal.h')
-rw-r--r--fs/dlm/dlm_internal.h53
1 files changed, 30 insertions, 23 deletions
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index ec61bbaf25d..d30ea8b433a 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -92,8 +92,6 @@ do { \
} \
}
-#define DLM_FAKE_USER_AST ERR_PTR(-EINVAL)
-
struct dlm_direntry {
struct list_head list;
@@ -146,9 +144,9 @@ struct dlm_recover {
struct dlm_args {
uint32_t flags;
- void *astaddr;
- long astparam;
- void *bastaddr;
+ void (*astfn) (void *astparam);
+ void *astparam;
+ void (*bastfn) (void *astparam, int mode);
int mode;
struct dlm_lksb *lksb;
unsigned long timeout;
@@ -253,9 +251,12 @@ struct dlm_lkb {
char *lkb_lvbptr;
struct dlm_lksb *lkb_lksb; /* caller's status block */
- void *lkb_astaddr; /* caller's ast function */
- void *lkb_bastaddr; /* caller's bast function */
- long lkb_astparam; /* caller's ast arg */
+ void (*lkb_astfn) (void *astparam);
+ void (*lkb_bastfn) (void *astparam, int mode);
+ union {
+ void *lkb_astparam; /* caller's ast arg */
+ struct dlm_user_args *lkb_ua;
+ };
};
@@ -403,28 +404,34 @@ struct dlm_rcom {
char rc_buf[0];
};
+union dlm_packet {
+ struct dlm_header header; /* common to other two */
+ struct dlm_message message;
+ struct dlm_rcom rcom;
+};
+
struct rcom_config {
- uint32_t rf_lvblen;
- uint32_t rf_lsflags;
- uint64_t rf_unused;
+ __le32 rf_lvblen;
+ __le32 rf_lsflags;
+ __le64 rf_unused;
};
struct rcom_lock {
- uint32_t rl_ownpid;
- uint32_t rl_lkid;
- uint32_t rl_remid;
- uint32_t rl_parent_lkid;
- uint32_t rl_parent_remid;
- uint32_t rl_exflags;
- uint32_t rl_flags;
- uint32_t rl_lvbseq;
- int rl_result;
+ __le32 rl_ownpid;
+ __le32 rl_lkid;
+ __le32 rl_remid;
+ __le32 rl_parent_lkid;
+ __le32 rl_parent_remid;
+ __le32 rl_exflags;
+ __le32 rl_flags;
+ __le32 rl_lvbseq;
+ __le32 rl_result;
int8_t rl_rqmode;
int8_t rl_grmode;
int8_t rl_status;
int8_t rl_asts;
- uint16_t rl_wait_type;
- uint16_t rl_namelen;
+ __le16 rl_wait_type;
+ __le16 rl_namelen;
char rl_name[DLM_RESNAME_MAXLEN];
char rl_lvb[0];
};
@@ -494,7 +501,7 @@ struct dlm_ls {
struct rw_semaphore ls_recv_active; /* block dlm_recv */
struct list_head ls_requestqueue;/* queue remote requests */
struct mutex ls_requestqueue_mutex;
- char *ls_recover_buf;
+ struct dlm_rcom *ls_recover_buf;
int ls_recover_nodeid; /* for debugging */
uint64_t ls_rcom_seq;
spinlock_t ls_rcom_spin;