Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e5fec31 authored by Fabian Frederick's avatar Fabian Frederick Committed by Jens Axboe
Browse files

drbd: code cleanups without semantic changes



This contains various cosmetic fixes ranging from simple typos to
const-ifying, and using booleans properly.

Original commit messages from Fabian's patch set:
drbd: debugfs: constify drbd_version_fops
drbd: use seq_put instead of seq_print where possible
drbd: include linux/uaccess.h instead of asm/uaccess.h
drbd: use const char * const for drbd strings
drbd: kerneldoc warning fix in w_e_end_data_req()
drbd: use unsigned for one bit fields
drbd: use bool for peer is_ states
drbd: fix typo
drbd: use | for bitmask combination
drbd: use true/false for bool
drbd: fix drbd_bm_init() comments
drbd: introduce peer state union
drbd: fix maybe_pull_ahead() locking comments
drbd: use bool for growing
drbd: remove redundant declarations
drbd: replace if/BUG by BUG_ON

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarRoland Kammerer <roland.kammerer@linbit.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 20004e24
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -427,8 +427,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
}
}


/*
/*
 * called on driver init only. TODO call when a device is created.
 * allocates the drbd_bitmap and stores it in device->bitmap.
 * allocates the drbd_bitmap, and stores it in device->bitmap.
 */
 */
int drbd_bm_init(struct drbd_device *device)
int drbd_bm_init(struct drbd_device *device)
{
{
@@ -633,7 +632,8 @@ int drbd_bm_resize(struct drbd_device *device, sector_t capacity, int set_new_bi
	unsigned long bits, words, owords, obits;
	unsigned long bits, words, owords, obits;
	unsigned long want, have, onpages; /* number of pages */
	unsigned long want, have, onpages; /* number of pages */
	struct page **npages, **opages = NULL;
	struct page **npages, **opages = NULL;
	int err = 0, growing;
	int err = 0;
	bool growing;


	if (!expect(b))
	if (!expect(b))
		return -ENOMEM;
		return -ENOMEM;
+1 −1
Original line number Original line Diff line number Diff line
@@ -903,7 +903,7 @@ static int drbd_version_open(struct inode *inode, struct file *file)
	return single_open(file, drbd_version_show, NULL);
	return single_open(file, drbd_version_show, NULL);
}
}


static struct file_operations drbd_version_fops = {
static const struct file_operations drbd_version_fops = {
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
	.open = drbd_version_open,
	.open = drbd_version_open,
	.llseek = seq_lseek,
	.llseek = seq_lseek,
+1 −3
Original line number Original line Diff line number Diff line
@@ -1499,7 +1499,7 @@ extern enum drbd_state_rv drbd_set_role(struct drbd_device *device,
					int force);
					int force);
extern bool conn_try_outdate_peer(struct drbd_connection *connection);
extern bool conn_try_outdate_peer(struct drbd_connection *connection);
extern void conn_try_outdate_peer_async(struct drbd_connection *connection);
extern void conn_try_outdate_peer_async(struct drbd_connection *connection);
extern int conn_khelper(struct drbd_connection *connection, char *cmd);
extern enum drbd_peer_state conn_khelper(struct drbd_connection *connection, char *cmd);
extern int drbd_khelper(struct drbd_device *device, char *cmd);
extern int drbd_khelper(struct drbd_device *device, char *cmd);


/* drbd_worker.c */
/* drbd_worker.c */
@@ -1648,8 +1648,6 @@ void drbd_bump_write_ordering(struct drbd_resource *resource, struct drbd_backin
/* drbd_proc.c */
/* drbd_proc.c */
extern struct proc_dir_entry *drbd_proc;
extern struct proc_dir_entry *drbd_proc;
extern const struct file_operations drbd_proc_fops;
extern const struct file_operations drbd_proc_fops;
extern const char *drbd_conn_str(enum drbd_conns s);
extern const char *drbd_role_str(enum drbd_role s);


/* drbd_actlog.c */
/* drbd_actlog.c */
extern bool drbd_al_begin_io_prepare(struct drbd_device *device, struct drbd_interval *i);
extern bool drbd_al_begin_io_prepare(struct drbd_device *device, struct drbd_interval *i);
+7 −7
Original line number Original line Diff line number Diff line
@@ -9,9 +9,9 @@ struct drbd_interval {
	sector_t sector;		/* start sector of the interval */
	sector_t sector;		/* start sector of the interval */
	unsigned int size;		/* size in bytes */
	unsigned int size;		/* size in bytes */
	sector_t end;			/* highest interval end in subtree */
	sector_t end;			/* highest interval end in subtree */
	int local:1		/* local or remote request? */;
	unsigned int local:1		/* local or remote request? */;
	int waiting:1;		/* someone is waiting for this to complete */
	unsigned int waiting:1;		/* someone is waiting for completion */
	int completed:1;	/* this has been completed already;
	unsigned int completed:1;	/* this has been completed already;
					 * ignore for conflict detection */
					 * ignore for conflict detection */
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/jiffies.h>
#include <linux/drbd.h>
#include <linux/drbd.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <asm/types.h>
#include <asm/types.h>
#include <net/sock.h>
#include <net/sock.h>
#include <linux/ctype.h>
#include <linux/ctype.h>
Loading