Skip to content

Commit

Permalink
drbd: Backport the "events2" command
Browse files Browse the repository at this point in the history
The events2 command originates from drbd-9 development. It features
more information but requires a incompatible change in output
format.
Therefore the previous events command continues to exist, the new
improved events2 command becomes available now.

This prepares the user-base for a later switch to the complete
drbd9 code base.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Andreas Gruenbacher authored and Jens Axboe committed Nov 25, 2015
1 parent 28bc3b8 commit a297284
Show file tree
Hide file tree
Showing 7 changed files with 1,281 additions and 12 deletions.
45 changes: 45 additions & 0 deletions drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@ enum {
DEVICE_WORK_PENDING, /* tell worker that some device has pending work */
};

enum which_state { NOW, OLD = NOW, NEW };

struct drbd_resource {
char *name;
#ifdef CONFIG_DEBUG_FS
Expand Down Expand Up @@ -785,6 +787,17 @@ struct drbd_connection {
} send;
};

static inline bool has_net_conf(struct drbd_connection *connection)
{
bool has_net_conf;

rcu_read_lock();
has_net_conf = rcu_dereference(connection->net_conf);
rcu_read_unlock();

return has_net_conf;
}

void __update_timing_details(
struct drbd_thread_timing_details *tdp,
unsigned int *cb_nr,
Expand Down Expand Up @@ -1017,6 +1030,12 @@ static inline struct drbd_peer_device *first_peer_device(struct drbd_device *dev
return list_first_entry_or_null(&device->peer_devices, struct drbd_peer_device, peer_devices);
}

static inline struct drbd_peer_device *
conn_peer_device(struct drbd_connection *connection, int volume_number)
{
return idr_find(&connection->peer_devices, volume_number);
}

#define for_each_resource(resource, _resources) \
list_for_each_entry(resource, _resources, resources)

Expand Down Expand Up @@ -1451,6 +1470,9 @@ extern int is_valid_ar_handle(struct drbd_request *, sector_t);


/* drbd_nl.c */

extern struct mutex notification_mutex;

extern void drbd_suspend_io(struct drbd_device *device);
extern void drbd_resume_io(struct drbd_device *device);
extern char *ppsize(char *buf, unsigned long long size);
Expand Down Expand Up @@ -1665,6 +1687,29 @@ struct sib_info {
};
void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib);

extern void notify_resource_state(struct sk_buff *,
unsigned int,
struct drbd_resource *,
struct resource_info *,
enum drbd_notification_type);
extern void notify_device_state(struct sk_buff *,
unsigned int,
struct drbd_device *,
struct device_info *,
enum drbd_notification_type);
extern void notify_connection_state(struct sk_buff *,
unsigned int,
struct drbd_connection *,
struct connection_info *,
enum drbd_notification_type);
extern void notify_peer_device_state(struct sk_buff *,
unsigned int,
struct drbd_peer_device *,
struct peer_device_info *,
enum drbd_notification_type);
extern void notify_helper(enum drbd_notification_type, struct drbd_device *,
struct drbd_connection *, const char *, int);

/*
* inline helper functions
*************************/
Expand Down
Loading

0 comments on commit a297284

Please sign in to comment.