Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
drbd_nl.c File Reference
#include <linux/module.h>
#include <linux/drbd.h>
#include <linux/in.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/slab.h>
#include <linux/connector.h>
#include <linux/blkpg.h>
#include <linux/cpumask.h>
#include "drbd_int.h"
#include "drbd_req.h"
#include "drbd_wrappers.h"
#include <asm/unaligned.h>
#include <linux/drbd_tag_magic.h>
#include <linux/drbd_limits.h>
#include <linux/compiler.h>
#include <linux/kthread.h>
#include <linux/drbd_nl.h>

Go to the source code of this file.

Data Structures

struct  cn_handler_struct
 

Macros

#define NL_PACKET(name, number, fields)
 
#define NL_INTEGER(pn, pr, member)
 
#define NL_INT64(pn, pr, member)
 
#define NL_BIT(pn, pr, member)
 
#define NL_STRING(pn, pr, member, len)
 
#define NL_PACKET(name, number, fields)
 
#define NL_INTEGER(pn, pr, member)
 
#define NL_INT64(pn, pr, member)
 
#define NL_BIT(pn, pr, member)
 
#define NL_STRING(pn, pr, member, len)
 
#define AL_MAX   ((MD_AL_MAX_SIZE-1) * AL_EXTENTS_PT)
 

Functions

void drbd_bcast_ev_helper (struct drbd_conf *mdev, char *helper_name)
 
void drbd_nl_send_reply (struct cn_msg *, int)
 
int drbd_khelper (struct drbd_conf *mdev, char *cmd)
 
enum drbd_disk_state drbd_try_outdate_peer (struct drbd_conf *mdev)
 
void drbd_try_outdate_peer_async (struct drbd_conf *mdev)
 
enum drbd_state_rv drbd_set_role (struct drbd_conf *mdev, enum drbd_role new_role, int force)
 
charppsize (char *buf, unsigned long long size)
 
void drbd_suspend_io (struct drbd_conf *mdev)
 
void drbd_resume_io (struct drbd_conf *mdev)
 
enum determine_dev_size drbd_determine_dev_size (struct drbd_conf *mdev, enum dds_flags flags) __must_hold(local)
 
sector_t drbd_new_dev_size (struct drbd_conf *mdev, struct drbd_backing_dev *bdev, int assume_peer_has_space)
 
void drbd_reconsider_max_bio_size (struct drbd_conf *mdev)
 
void resync_after_online_grow (struct drbd_conf *mdev)
 
void drbd_bcast_state (struct drbd_conf *mdev, union drbd_state state)
 
void drbd_bcast_ee (struct drbd_conf *mdev, const char *reason, const int dgs, const char *seen_hash, const char *calc_hash, const struct drbd_epoch_entry *e)
 
void drbd_bcast_sync_progress (struct drbd_conf *mdev)
 
int __init drbd_nl_init (void)
 
void drbd_nl_cleanup (void)
 

Macro Definition Documentation

#define AL_MAX   ((MD_AL_MAX_SIZE-1) * AL_EXTENTS_PT)
#define NL_BIT (   pn,
  pr,
  member 
)
Value:
case pn: /* D_ASSERT( tag_type(tag) == TT_BIT ); */ \
arg->member = *(char *)(tags) ? 1 : 0; \
break;

Definition at line 122 of file drbd_nl.c.

#define NL_BIT (   pn,
  pr,
  member 
)
Value:
put_unaligned(sizeof(char), tags++); \
*(char *)tags = arg->member; \
tags = (unsigned short *)((char *)tags+sizeof(char));

Definition at line 122 of file drbd_nl.c.

#define NL_INT64 (   pn,
  pr,
  member 
)
Value:
case pn: /* D_ASSERT( tag_type(tag) == TT_INT64 ); */ \
arg->member = get_unaligned((u64 *)(tags)); \
break;

Definition at line 117 of file drbd_nl.c.

#define NL_INT64 (   pn,
  pr,
  member 
)
Value:
put_unaligned(sizeof(u64), tags++); \
put_unaligned(arg->member, (u64 *)tags); \
tags = (unsigned short *)((char *)tags+sizeof(u64));

Definition at line 117 of file drbd_nl.c.

#define NL_INTEGER (   pn,
  pr,
  member 
)
Value:
case pn: /* D_ASSERT( tag_type(tag) == TT_INTEGER ); */ \
arg->member = get_unaligned((int *)(tags)); \
break;

Definition at line 112 of file drbd_nl.c.

#define NL_INTEGER (   pn,
  pr,
  member 
)
Value:
put_unaligned(sizeof(int), tags++); \
put_unaligned(arg->member, (int *)tags); \
tags = (unsigned short *)((char *)tags+sizeof(int));

Definition at line 112 of file drbd_nl.c.

#define NL_PACKET (   name,
  number,
  fields 
)
Value:
static int name ## _from_tags(struct drbd_conf *mdev, \
unsigned short *tags, struct name *arg) __attribute__ ((unused)); \
static int name ## _from_tags(struct drbd_conf *mdev, \
unsigned short *tags, struct name *arg) \
{ \
int tag; \
int dlen; \
\
while ((tag = get_unaligned(tags++)) != TT_END) { \
dlen = get_unaligned(tags++); \
switch (tag_number(tag)) { \
fields \
default: \
if (tag & T_MANDATORY) { \
dev_err(DEV, "Unknown tag: %d\n", tag_number(tag)); \
return 0; \
} \
} \
tags = (unsigned short *)((char *)tags + dlen); \
} \
return 1; \
}

Definition at line 100 of file drbd_nl.c.

#define NL_PACKET (   name,
  number,
  fields 
)
Value:
static unsigned short* \
name ## _to_tags(struct drbd_conf *mdev, \
struct name *arg, unsigned short *tags) __attribute__ ((unused)); \
static unsigned short* \
name ## _to_tags(struct drbd_conf *mdev, \
struct name *arg, unsigned short *tags) \
{ \
fields \
return tags; \
}

Definition at line 100 of file drbd_nl.c.

#define NL_STRING (   pn,
  pr,
  member,
  len 
)
Value:
case pn: /* D_ASSERT( tag_type(tag) == TT_STRING ); */ \
if (dlen > len) { \
dev_err(DEV, "arg too long: %s (%u wanted, max len: %u bytes)\n", \
#member, dlen, (unsigned int)len); \
return 0; \
} \
arg->member ## _len = dlen; \
memcpy(arg->member, tags, min_t(size_t, dlen, len)); \
break;

Definition at line 127 of file drbd_nl.c.

#define NL_STRING (   pn,
  pr,
  member,
  len 
)
Value:
put_unaligned(arg->member ## _len, tags++); \
memcpy(tags, arg->member, arg->member ## _len); \
tags = (unsigned short *)((char *)tags + arg->member ## _len);

Definition at line 127 of file drbd_nl.c.

Function Documentation

void drbd_bcast_ee ( struct drbd_conf mdev,
const char reason,
const int  dgs,
const char seen_hash,
const char calc_hash,
const struct drbd_epoch_entry e 
)

Definition at line 2526 of file drbd_nl.c.

void drbd_bcast_ev_helper ( struct drbd_conf mdev,
char helper_name 
)

Definition at line 2494 of file drbd_nl.c.

void drbd_bcast_state ( struct drbd_conf mdev,
union drbd_state  state 
)

Definition at line 2461 of file drbd_nl.c.

void drbd_bcast_sync_progress ( struct drbd_conf mdev)

Definition at line 2605 of file drbd_nl.c.

enum determine_dev_size drbd_determine_dev_size ( struct drbd_conf mdev,
enum dds_flags  flags 
)

drbd_determine_dev_size() - Sets the right device size obeying all constraints : DRBD device.

Returns 0 on success, negative return values indicate errors. You should call drbd_md_sync() after calling this function.

Definition at line 605 of file drbd_nl.c.

int drbd_khelper ( struct drbd_conf mdev,
char cmd 
)

Definition at line 137 of file drbd_nl.c.

sector_t drbd_new_dev_size ( struct drbd_conf mdev,
struct drbd_backing_dev bdev,
int  assume_peer_has_space 
)

Definition at line 699 of file drbd_nl.c.

void drbd_nl_cleanup ( void  )

Definition at line 2665 of file drbd_nl.c.

int __init drbd_nl_init ( void  )

Definition at line 2643 of file drbd_nl.c.

void drbd_nl_send_reply ( struct cn_msg req,
int  ret_code 
)

Definition at line 2675 of file drbd_nl.c.

void drbd_reconsider_max_bio_size ( struct drbd_conf mdev)

Definition at line 836 of file drbd_nl.c.

void drbd_resume_io ( struct drbd_conf mdev)

Definition at line 592 of file drbd_nl.c.

enum drbd_state_rv drbd_set_role ( struct drbd_conf mdev,
enum drbd_role  new_role,
int  force 
)

Definition at line 317 of file drbd_nl.c.

void drbd_suspend_io ( struct drbd_conf mdev)

Definition at line 584 of file drbd_nl.c.

enum drbd_disk_state drbd_try_outdate_peer ( struct drbd_conf mdev)

Definition at line 204 of file drbd_nl.c.

void drbd_try_outdate_peer_async ( struct drbd_conf mdev)

Definition at line 307 of file drbd_nl.c.

char* ppsize ( char buf,
unsigned long long  size 
)

Definition at line 555 of file drbd_nl.c.

void resync_after_online_grow ( struct drbd_conf mdev)

Definition at line 1700 of file drbd_nl.c.