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

Commit 36558c8a authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

blkcg: style cleanups for blk-cgroup.h



* Update indentation on struct field declarations.

* Uniformly don't use "extern" on function declarations.

* Merge the two #ifdef CONFIG_BLK_CGROUP blocks.

All changes in this patch are cosmetic.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 54e7ed12
Loading
Loading
Loading
Loading
+52 −56
Original line number Diff line number Diff line
@@ -98,20 +98,30 @@ struct blkio_policy_ops {
struct blkio_policy_type {
	struct blkio_policy_ops		ops;
	int				plid;
	size_t pdata_size;		/* policy specific private data size */
	struct cftype *cftypes;		/* cgroup files for the policy */
	/* policy specific private data size */
	size_t				pdata_size;
	/* cgroup files for the policy */
	struct cftype			*cftypes;
};

extern int blkcg_init_queue(struct request_queue *q);
extern void blkcg_drain_queue(struct request_queue *q);
extern void blkcg_exit_queue(struct request_queue *q);
extern struct blkio_cgroup blkio_root_cgroup;

struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);
struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio);
struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg,
				struct request_queue *q);
struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg,
				       struct request_queue *q);
int blkcg_init_queue(struct request_queue *q);
void blkcg_drain_queue(struct request_queue *q);
void blkcg_exit_queue(struct request_queue *q);

/* Blkio controller policy registration */
extern int blkio_policy_register(struct blkio_policy_type *);
extern void blkio_policy_unregister(struct blkio_policy_type *);
extern int blkcg_activate_policy(struct request_queue *q,
int blkio_policy_register(struct blkio_policy_type *);
void blkio_policy_unregister(struct blkio_policy_type *);
int blkcg_activate_policy(struct request_queue *q,
			  const struct blkio_policy_type *pol);
extern void blkcg_deactivate_policy(struct request_queue *q,
void blkcg_deactivate_policy(struct request_queue *q,
			     const struct blkio_policy_type *pol);

void blkcg_print_blkgs(struct seq_file *sf, struct blkio_cgroup *blkcg,
@@ -329,7 +339,9 @@ static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat)
	memset(rwstat->cnt, 0, sizeof(rwstat->cnt));
}

#else
#else	/* CONFIG_BLK_CGROUP */

struct cgroup;

struct blkio_group {
};
@@ -337,6 +349,9 @@ struct blkio_group {
struct blkio_policy_type {
};

static inline struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; }
static inline struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio) { return NULL; }
static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg, void *key) { return NULL; }
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
static inline void blkcg_drain_queue(struct request_queue *q) { }
static inline void blkcg_exit_queue(struct request_queue *q) { }
@@ -355,24 +370,5 @@ static inline char *blkg_path(struct blkio_group *blkg) { return NULL; }
static inline void blkg_get(struct blkio_group *blkg) { }
static inline void blkg_put(struct blkio_group *blkg) { }

#endif

#ifdef CONFIG_BLK_CGROUP
extern struct blkio_cgroup blkio_root_cgroup;
extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);
extern struct blkio_cgroup *bio_blkio_cgroup(struct bio *bio);
extern struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg,
				       struct request_queue *q);
struct blkio_group *blkg_lookup_create(struct blkio_cgroup *blkcg,
				       struct request_queue *q);
#else
struct cgroup;
static inline struct blkio_cgroup *
cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; }
static inline struct blkio_cgroup *
bio_blkio_cgroup(struct bio *bio) { return NULL; }

static inline struct blkio_group *blkg_lookup(struct blkio_cgroup *blkcg,
					      void *key) { return NULL; }
#endif
#endif	/* CONFIG_BLK_CGROUP */
#endif	/* _BLK_CGROUP_H */