mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
codebase style improvements for OpenZFS 6459 port
This commit is contained in:
committed by
Brian Behlendorf
parent
ec441a9c53
commit
4ea3f86426
+9
-8
@@ -423,7 +423,8 @@ struct scatterlist {
|
||||
};
|
||||
|
||||
static void
|
||||
sg_init_table(struct scatterlist *sg, int nr) {
|
||||
sg_init_table(struct scatterlist *sg, int nr)
|
||||
{
|
||||
memset(sg, 0, nr * sizeof (struct scatterlist));
|
||||
sg[nr - 1].end = 1;
|
||||
}
|
||||
@@ -1315,8 +1316,8 @@ abd_cmp(abd_t *dabd, abd_t *sabd)
|
||||
*/
|
||||
void
|
||||
abd_raidz_gen_iterate(abd_t **cabds, abd_t *dabd,
|
||||
ssize_t csize, ssize_t dsize, const unsigned parity,
|
||||
void (*func_raidz_gen)(void **, const void *, size_t, size_t))
|
||||
ssize_t csize, ssize_t dsize, const unsigned parity,
|
||||
void (*func_raidz_gen)(void **, const void *, size_t, size_t))
|
||||
{
|
||||
int i;
|
||||
ssize_t len, dlen;
|
||||
@@ -1407,10 +1408,10 @@ abd_raidz_gen_iterate(abd_t **cabds, abd_t *dabd,
|
||||
*/
|
||||
void
|
||||
abd_raidz_rec_iterate(abd_t **cabds, abd_t **tabds,
|
||||
ssize_t tsize, const unsigned parity,
|
||||
void (*func_raidz_rec)(void **t, const size_t tsize, void **c,
|
||||
const unsigned *mul),
|
||||
const unsigned *mul)
|
||||
ssize_t tsize, const unsigned parity,
|
||||
void (*func_raidz_rec)(void **t, const size_t tsize, void **c,
|
||||
const unsigned *mul),
|
||||
const unsigned *mul)
|
||||
{
|
||||
int i;
|
||||
ssize_t len;
|
||||
@@ -1497,7 +1498,7 @@ abd_nr_pages_off(abd_t *abd, unsigned int size, size_t off)
|
||||
*/
|
||||
unsigned int
|
||||
abd_scatter_bio_map_off(struct bio *bio, abd_t *abd,
|
||||
unsigned int io_size, size_t off)
|
||||
unsigned int io_size, size_t off)
|
||||
{
|
||||
int i;
|
||||
struct abd_iter aiter;
|
||||
|
||||
+2
-1
@@ -4336,7 +4336,8 @@ arc_reclaim_thread(void)
|
||||
* increase this negative difference.
|
||||
*/
|
||||
static uint64_t
|
||||
arc_evictable_memory(void) {
|
||||
arc_evictable_memory(void)
|
||||
{
|
||||
uint64_t arc_clean =
|
||||
refcount_count(&arc_mru->arcs_esize[ARC_BUFC_DATA]) +
|
||||
refcount_count(&arc_mru->arcs_esize[ARC_BUFC_METADATA]) +
|
||||
|
||||
+2
-2
@@ -2787,8 +2787,8 @@ dbuf_hold_impl(dnode_t *dn, uint8_t level, uint64_t blkid,
|
||||
static void
|
||||
__dbuf_hold_impl_init(struct dbuf_hold_impl_data *dh,
|
||||
dnode_t *dn, uint8_t level, uint64_t blkid,
|
||||
boolean_t fail_sparse, boolean_t fail_uncached,
|
||||
void *tag, dmu_buf_impl_t **dbp, int depth)
|
||||
boolean_t fail_sparse, boolean_t fail_uncached,
|
||||
void *tag, dmu_buf_impl_t **dbp, int depth)
|
||||
{
|
||||
dh->dh_dn = dn;
|
||||
dh->dh_level = level;
|
||||
|
||||
+3
-3
@@ -1745,7 +1745,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_sync_cb_t *done, zgd_t *zgd)
|
||||
|
||||
int
|
||||
dmu_object_set_blocksize(objset_t *os, uint64_t object, uint64_t size, int ibs,
|
||||
dmu_tx_t *tx)
|
||||
dmu_tx_t *tx)
|
||||
{
|
||||
dnode_t *dn;
|
||||
int err;
|
||||
@@ -1760,7 +1760,7 @@ dmu_object_set_blocksize(objset_t *os, uint64_t object, uint64_t size, int ibs,
|
||||
|
||||
void
|
||||
dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum,
|
||||
dmu_tx_t *tx)
|
||||
dmu_tx_t *tx)
|
||||
{
|
||||
dnode_t *dn;
|
||||
|
||||
@@ -1780,7 +1780,7 @@ dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum,
|
||||
|
||||
void
|
||||
dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress,
|
||||
dmu_tx_t *tx)
|
||||
dmu_tx_t *tx)
|
||||
{
|
||||
dnode_t *dn;
|
||||
|
||||
|
||||
@@ -2090,7 +2090,7 @@ save_resume_state(struct receive_writer_arg *rwa,
|
||||
|
||||
noinline static int
|
||||
receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
|
||||
void *data)
|
||||
void *data)
|
||||
{
|
||||
dmu_object_info_t doi;
|
||||
dmu_tx_t *tx;
|
||||
@@ -2226,7 +2226,7 @@ receive_freeobjects(struct receive_writer_arg *rwa,
|
||||
|
||||
noinline static int
|
||||
receive_write(struct receive_writer_arg *rwa, struct drr_write *drrw,
|
||||
arc_buf_t *abuf)
|
||||
arc_buf_t *abuf)
|
||||
{
|
||||
dmu_tx_t *tx;
|
||||
dmu_buf_t *bonus;
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ secpolicy_sys_config(const cred_t *cr, boolean_t checkonly)
|
||||
*/
|
||||
int
|
||||
secpolicy_vnode_access2(const cred_t *cr, struct inode *ip, uid_t owner,
|
||||
mode_t curmode, mode_t wantmode)
|
||||
mode_t curmode, mode_t wantmode)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -1612,7 +1612,8 @@ spa_get_asize(spa_t *spa, uint64_t lsize)
|
||||
* See the comment above spa_slop_shift for details.
|
||||
*/
|
||||
uint64_t
|
||||
spa_get_slop_space(spa_t *spa) {
|
||||
spa_get_slop_space(spa_t *spa)
|
||||
{
|
||||
uint64_t space = spa_get_dspace(spa);
|
||||
return (MAX(space >> spa_slop_shift, SPA_MINDEVSIZE >> 1));
|
||||
}
|
||||
|
||||
+2
-1
@@ -3676,9 +3676,10 @@ EXPORT_SYMBOL(vdev_degrade);
|
||||
EXPORT_SYMBOL(vdev_online);
|
||||
EXPORT_SYMBOL(vdev_offline);
|
||||
EXPORT_SYMBOL(vdev_clear);
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
module_param(metaslabs_per_vdev, int, 0644);
|
||||
MODULE_PARM_DESC(metaslabs_per_vdev,
|
||||
"Divide added vdev into approximately (but no more than) this number "
|
||||
"of metaslabs");
|
||||
/* END CSTYLED */
|
||||
#endif
|
||||
|
||||
@@ -646,6 +646,7 @@ vdev_ops_t vdev_spare_ops = {
|
||||
};
|
||||
|
||||
#if defined(_KERNEL) && defined(HAVE_SPL)
|
||||
/* BEGIN CSTYLED */
|
||||
module_param(zfs_vdev_mirror_rotating_inc, int, 0644);
|
||||
MODULE_PARM_DESC(zfs_vdev_mirror_rotating_inc,
|
||||
"Rotating media load increment for non-seeking I/O's");
|
||||
@@ -655,6 +656,7 @@ MODULE_PARM_DESC(zfs_vdev_mirror_rotating_seek_inc,
|
||||
"Rotating media load increment for seeking I/O's");
|
||||
|
||||
module_param(zfs_vdev_mirror_rotating_seek_offset, int, 0644);
|
||||
|
||||
MODULE_PARM_DESC(zfs_vdev_mirror_rotating_seek_offset,
|
||||
"Offset in bytes from the last I/O which "
|
||||
"triggers a reduced rotating media seek increment");
|
||||
@@ -666,5 +668,5 @@ MODULE_PARM_DESC(zfs_vdev_mirror_non_rotating_inc,
|
||||
module_param(zfs_vdev_mirror_non_rotating_seek_inc, int, 0644);
|
||||
MODULE_PARM_DESC(zfs_vdev_mirror_non_rotating_seek_inc,
|
||||
"Non-rotating media load increment for seeking I/O's");
|
||||
|
||||
/* END CSTYLED */
|
||||
#endif
|
||||
|
||||
@@ -177,7 +177,7 @@ vdev_raidz_math_generate(raidz_map_t *rm)
|
||||
|
||||
static raidz_rec_f
|
||||
reconstruct_fun_p_sel(raidz_map_t *rm, const int *parity_valid,
|
||||
const int nbaddata)
|
||||
const int nbaddata)
|
||||
{
|
||||
if (nbaddata == 1 && parity_valid[CODE_P]) {
|
||||
return (rm->rm_ops->rec[RAIDZ_REC_P]);
|
||||
@@ -187,7 +187,7 @@ reconstruct_fun_p_sel(raidz_map_t *rm, const int *parity_valid,
|
||||
|
||||
static raidz_rec_f
|
||||
reconstruct_fun_pq_sel(raidz_map_t *rm, const int *parity_valid,
|
||||
const int nbaddata)
|
||||
const int nbaddata)
|
||||
{
|
||||
if (nbaddata == 1) {
|
||||
if (parity_valid[CODE_P]) {
|
||||
@@ -204,7 +204,7 @@ reconstruct_fun_pq_sel(raidz_map_t *rm, const int *parity_valid,
|
||||
|
||||
static raidz_rec_f
|
||||
reconstruct_fun_pqr_sel(raidz_map_t *rm, const int *parity_valid,
|
||||
const int nbaddata)
|
||||
const int nbaddata)
|
||||
{
|
||||
if (nbaddata == 1) {
|
||||
if (parity_valid[CODE_P]) {
|
||||
@@ -238,7 +238,7 @@ reconstruct_fun_pqr_sel(raidz_map_t *rm, const int *parity_valid,
|
||||
*/
|
||||
int
|
||||
vdev_raidz_math_reconstruct(raidz_map_t *rm, const int *parity_valid,
|
||||
const int *dt, const int nbaddata)
|
||||
const int *dt, const int nbaddata)
|
||||
{
|
||||
raidz_rec_f rec_fn = NULL;
|
||||
|
||||
@@ -647,6 +647,6 @@ zfs_vdev_raidz_impl_get(char *buffer, zfs_kernel_param_t *kp)
|
||||
}
|
||||
|
||||
module_param_call(zfs_vdev_raidz_impl, zfs_vdev_raidz_impl_set,
|
||||
zfs_vdev_raidz_impl_get, NULL, 0644);
|
||||
zfs_vdev_raidz_impl_get, NULL, 0644);
|
||||
MODULE_PARM_DESC(zfs_vdev_raidz_impl, "Select raidz implementation.");
|
||||
#endif
|
||||
|
||||
@@ -223,7 +223,7 @@ const raidz_impl_ops_t vdev_raidz_aarch64_neon_impl = {
|
||||
|
||||
|
||||
#if defined(__aarch64__)
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
const uint8_t
|
||||
__attribute__((aligned(256))) gf_clmul_mod_lt[4*256][16] = {
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -2275,5 +2275,5 @@ __attribute__((aligned(256))) gf_clmul_mod_lt[4*256][16] = {
|
||||
{ 0x00, 0xff, 0xfe, 0x01, 0xfc, 0x03, 0x02, 0xfd,
|
||||
0xf8, 0x07, 0x06, 0xf9, 0x04, 0xfb, 0xfa, 0x05 }
|
||||
};
|
||||
|
||||
/* END CSTYLED */
|
||||
#endif /* defined(__aarch64__) */
|
||||
|
||||
@@ -387,7 +387,7 @@ raidz_generate_p_impl(raidz_map_t * const rm)
|
||||
*/
|
||||
static void
|
||||
raidz_gen_pq_add(void **c, const void *dc, const size_t csize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *p = (v_t *)c[0];
|
||||
v_t *q = (v_t *)c[1];
|
||||
@@ -457,7 +457,7 @@ raidz_generate_pq_impl(raidz_map_t * const rm)
|
||||
*/
|
||||
static void
|
||||
raidz_gen_pqr_add(void **c, const void *dc, const size_t csize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *p = (v_t *)c[0];
|
||||
v_t *q = (v_t *)c[1];
|
||||
@@ -626,7 +626,7 @@ raidz_reconstruct_p_impl(raidz_map_t *rm, const int *tgtidx)
|
||||
*/
|
||||
static void
|
||||
raidz_syn_q_abd(void **xc, const void *dc, const size_t xsize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *x = (v_t *)xc[TARGET_X];
|
||||
const v_t *d = (v_t *)dc;
|
||||
@@ -717,7 +717,7 @@ raidz_reconstruct_q_impl(raidz_map_t *rm, const int *tgtidx)
|
||||
*/
|
||||
static void
|
||||
raidz_syn_r_abd(void **xc, const void *dc, const size_t tsize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *x = (v_t *)xc[TARGET_X];
|
||||
const v_t *d = (v_t *)dc;
|
||||
@@ -809,7 +809,7 @@ raidz_reconstruct_r_impl(raidz_map_t *rm, const int *tgtidx)
|
||||
*/
|
||||
static void
|
||||
raidz_syn_pq_abd(void **tc, const void *dc, const size_t tsize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *x = (v_t *)tc[TARGET_X];
|
||||
v_t *y = (v_t *)tc[TARGET_Y];
|
||||
@@ -841,7 +841,7 @@ raidz_syn_pq_abd(void **tc, const void *dc, const size_t tsize,
|
||||
*/
|
||||
static void
|
||||
raidz_rec_pq_abd(void **tc, const size_t tsize, void **c,
|
||||
const unsigned *mul)
|
||||
const unsigned *mul)
|
||||
{
|
||||
v_t *x = (v_t *)tc[TARGET_X];
|
||||
v_t *y = (v_t *)tc[TARGET_Y];
|
||||
@@ -967,7 +967,7 @@ raidz_reconstruct_pq_impl(raidz_map_t *rm, const int *tgtidx)
|
||||
*/
|
||||
static void
|
||||
raidz_syn_pr_abd(void **c, const void *dc, const size_t tsize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *x = (v_t *)c[TARGET_X];
|
||||
v_t *y = (v_t *)c[TARGET_Y];
|
||||
@@ -999,7 +999,7 @@ raidz_syn_pr_abd(void **c, const void *dc, const size_t tsize,
|
||||
*/
|
||||
static void
|
||||
raidz_rec_pr_abd(void **t, const size_t tsize, void **c,
|
||||
const unsigned *mul)
|
||||
const unsigned *mul)
|
||||
{
|
||||
v_t *x = (v_t *)t[TARGET_X];
|
||||
v_t *y = (v_t *)t[TARGET_Y];
|
||||
@@ -1125,7 +1125,7 @@ raidz_reconstruct_pr_impl(raidz_map_t *rm, const int *tgtidx)
|
||||
*/
|
||||
static void
|
||||
raidz_syn_qr_abd(void **c, const void *dc, const size_t tsize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *x = (v_t *)c[TARGET_X];
|
||||
v_t *y = (v_t *)c[TARGET_Y];
|
||||
@@ -1159,7 +1159,7 @@ raidz_syn_qr_abd(void **c, const void *dc, const size_t tsize,
|
||||
*/
|
||||
static void
|
||||
raidz_rec_qr_abd(void **t, const size_t tsize, void **c,
|
||||
const unsigned *mul)
|
||||
const unsigned *mul)
|
||||
{
|
||||
v_t *x = (v_t *)t[TARGET_X];
|
||||
v_t *y = (v_t *)t[TARGET_Y];
|
||||
@@ -1289,7 +1289,7 @@ raidz_reconstruct_qr_impl(raidz_map_t *rm, const int *tgtidx)
|
||||
*/
|
||||
static void
|
||||
raidz_syn_pqr_abd(void **c, const void *dc, const size_t tsize,
|
||||
const size_t dsize)
|
||||
const size_t dsize)
|
||||
{
|
||||
v_t *x = (v_t *)c[TARGET_X];
|
||||
v_t *y = (v_t *)c[TARGET_Y];
|
||||
@@ -1326,7 +1326,7 @@ raidz_syn_pqr_abd(void **c, const void *dc, const size_t tsize,
|
||||
*/
|
||||
static void
|
||||
raidz_rec_pqr_abd(void **t, const size_t tsize, void **c,
|
||||
const unsigned * const mul)
|
||||
const unsigned * const mul)
|
||||
{
|
||||
v_t *x = (v_t *)t[TARGET_X];
|
||||
v_t *y = (v_t *)t[TARGET_Y];
|
||||
|
||||
@@ -417,9 +417,10 @@ const raidz_impl_ops_t vdev_raidz_ssse3_impl = {
|
||||
|
||||
#if defined(__x86_64)
|
||||
#if defined(HAVE_SSSE3) || defined(HAVE_AVX2) || defined(HAVE_AVX512BW)
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
const uint8_t
|
||||
__attribute__((aligned(256))) gf_clmul_mod_lt[4*256][16] = {
|
||||
__attribute__((aligned(256))) gf_clmul_mod_lt[4*256][16] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -2469,6 +2470,6 @@ __attribute__((aligned(256))) gf_clmul_mod_lt[4*256][16] = {
|
||||
{ 0x00, 0xff, 0xfe, 0x01, 0xfc, 0x03, 0x02, 0xfd,
|
||||
0xf8, 0x07, 0x06, 0xf9, 0x04, 0xfb, 0xfa, 0x05 }
|
||||
};
|
||||
|
||||
/* END CSTYLED */
|
||||
#endif /* defined(HAVE_SSSE3) || defined(HAVE_AVX2) || defined(HAVE_AVX512BW) */
|
||||
#endif /* defined(__x86_64) */
|
||||
|
||||
@@ -958,7 +958,7 @@ out:
|
||||
*/
|
||||
int
|
||||
zfsctl_snapdir_mkdir(struct inode *dip, char *dirname, vattr_t *vap,
|
||||
struct inode **ipp, cred_t *cr, int flags)
|
||||
struct inode **ipp, cred_t *cr, int flags)
|
||||
{
|
||||
zfs_sb_t *zsb = ITOZSB(dip);
|
||||
char *dsname;
|
||||
|
||||
+2
-2
@@ -1043,8 +1043,8 @@ zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
|
||||
*/
|
||||
zio_t *
|
||||
zio_vdev_child_io(zio_t *pio, blkptr_t *bp, vdev_t *vd, uint64_t offset,
|
||||
abd_t *data, uint64_t size, int type, zio_priority_t priority,
|
||||
enum zio_flag flags, zio_done_func_t *done, void *private)
|
||||
abd_t *data, uint64_t size, int type, zio_priority_t priority,
|
||||
enum zio_flag flags, zio_done_func_t *done, void *private)
|
||||
{
|
||||
enum zio_stage pipeline = ZIO_VDEV_CHILD_PIPELINE;
|
||||
zio_t *zio;
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
abd_checksum_off(abd_t *abd, uint64_t size,
|
||||
const void *ctx_template, zio_cksum_t *zcp)
|
||||
const void *ctx_template, zio_cksum_t *zcp)
|
||||
{
|
||||
ZIO_SET_CHECKSUM(zcp, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ zpl_readpage(struct file *filp, struct page *pp)
|
||||
*/
|
||||
static int
|
||||
zpl_readpages(struct file *filp, struct address_space *mapping,
|
||||
struct list_head *pages, unsigned nr_pages)
|
||||
struct list_head *pages, unsigned nr_pages)
|
||||
{
|
||||
return (read_cache_pages(mapping, pages,
|
||||
(filler_t *)zpl_readpage, filp));
|
||||
|
||||
+2
-1
@@ -1934,7 +1934,8 @@ typedef struct zvol_snapdev_cb_arg {
|
||||
} zvol_snapdev_cb_arg_t;
|
||||
|
||||
static int
|
||||
zvol_set_snapdev_cb(const char *dsname, void *param) {
|
||||
zvol_set_snapdev_cb(const char *dsname, void *param)
|
||||
{
|
||||
zvol_snapdev_cb_arg_t *arg = param;
|
||||
|
||||
if (strchr(dsname, '@') == NULL)
|
||||
|
||||
Reference in New Issue
Block a user