This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit f2f00a9a3b7ba9256742597a38d5e7b2e2e77bea
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 20:21:04 2022 +0000
libgfs2: Namespace improvements - gfs2_disk_hash.c
Use the lgfs2_ prefix in libgfs2 interface names.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/pass2.c | 2 +-
gfs2/libgfs2/fs_ops.c | 12 ++++++------
gfs2/libgfs2/gfs2_disk_hash.c | 5 ++---
gfs2/libgfs2/libgfs2.h | 7 +++----
gfs2/libgfs2/rgrp.c | 4 ++--
gfs2/libgfs2/structures.c | 2 +-
6 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 3d732772..d394f6bf 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -470,7 +470,7 @@ static int basic_dentry_checks(struct gfs2_inode *ip, struct
gfs2_dirent *dent,
return 1;
}
- calculated_hash = gfs2_disk_hash(tmp_name, d->dr_name_len);
+ calculated_hash = lgfs2_disk_hash(tmp_name, d->dr_name_len);
if (d->dr_hash != calculated_hash){
log_err( _("Dir entry with bad hash or name length\n"
"\tHash found = %u (0x%x)\n"
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 4e10ab4f..4e3736ca 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -1148,7 +1148,7 @@ static int dir_e_add(struct gfs2_inode *dip, const char *filename,
int len,
uint64_t leaf_no, bn;
int err = 0;
- hash = gfs2_disk_hash(filename, len);
+ hash = lgfs2_disk_hash(filename, len);
restart:
/* Have to kludge because (hash >> 32) gives hash for some reason. */
if (dip->i_depth)
@@ -1313,7 +1313,7 @@ static int dir_l_add(struct gfs2_inode *dip, const char *filename,
int len,
}
lgfs2_inum_out(inum, &dent->de_inum);
- de_hash = gfs2_disk_hash(filename, len);
+ de_hash = lgfs2_disk_hash(filename, len);
dent->de_hash = cpu_to_be32(de_hash);
dent->de_type = cpu_to_be16(type);
memcpy((char *)(dent + 1), filename, len);
@@ -1376,7 +1376,7 @@ static int __init_dinode(struct gfs2_sbd *sdp, struct
gfs2_buffer_head **bhp, st
uint32_t hash;
uint16_t len;
- hash = gfs2_disk_hash(".", 1);
+ hash = lgfs2_disk_hash(".", 1);
len = GFS2_DIRENT_SIZE(1);
de.de_inum = di->di_num;
de.de_hash = cpu_to_be32(hash);
@@ -1387,7 +1387,7 @@ static int __init_dinode(struct gfs2_sbd *sdp, struct
gfs2_buffer_head **bhp, st
p[sizeof(de)] = '.';
p += len;
- hash = gfs2_disk_hash("..", 2);
+ hash = lgfs2_disk_hash("..", 2);
len = sdp->sd_bsize - (p - bh->b_data);
de.de_inum.no_formal_ino = cpu_to_be64(parent->in_formal_ino);
de.de_inum.no_addr = cpu_to_be64(parent->in_addr);
@@ -1598,7 +1598,7 @@ static int leaf_search(struct gfs2_inode *dip, struct
gfs2_buffer_head *bh,
else
return -1;
- hash = gfs2_disk_hash(filename, len);
+ hash = lgfs2_disk_hash(filename, len);
do{
if (!dent->de_inum.no_formal_ino){
@@ -1650,7 +1650,7 @@ static int linked_leaf_search(struct gfs2_inode *dip, const char
*filename,
/* Figure out the address of the leaf node. */
- hash = gfs2_disk_hash(filename, len);
+ hash = lgfs2_disk_hash(filename, len);
lindex = hash >> (32 - dip->i_depth);
error = get_first_leaf(dip, lindex, &bh_next);
diff --git a/gfs2/libgfs2/gfs2_disk_hash.c b/gfs2/libgfs2/gfs2_disk_hash.c
index 959f5ddc..07632a28 100644
--- a/gfs2/libgfs2/gfs2_disk_hash.c
+++ b/gfs2/libgfs2/gfs2_disk_hash.c
@@ -40,7 +40,7 @@ static const uint32_t crc_32_tab[] =
};
/**
- * gfs2_disk_hash - hash an array of data
+ * lgfs2_disk_hash - hash an array of data
* @data: the data to be hashed
* @len: the length of data to be hashed
*
@@ -59,7 +59,7 @@ static const uint32_t crc_32_tab[] =
* Returns: the hash
*/
-uint32_t gfs2_disk_hash(const char *data, int len)
+uint32_t lgfs2_disk_hash(const char *data, int len)
{
uint32_t hash = 0xFFFFFFFF;
@@ -71,4 +71,3 @@ uint32_t gfs2_disk_hash(const char *data, int len)
return hash;
}
-
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index aede5cda..5c2f1aa7 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -783,11 +783,10 @@ extern int lgfs2_read_sb(struct gfs2_sbd *sdp);
extern int lgfs2_rindex_read(struct gfs2_sbd *sdp, uint64_t *rgcount, int *ok);
extern int lgfs2_write_sb(struct gfs2_sbd *sdp);
-/* ondisk.c */
-extern uint32_t gfs2_disk_hash(const char *data, int len);
-
-/* Translation functions */
+/* gfs2_disk_hash.c */
+extern uint32_t lgfs2_disk_hash(const char *data, int len);
+/* ondisk.c */
extern void lgfs2_inum_in(struct lgfs2_inum *i, void *inp);
extern void lgfs2_inum_out(const struct lgfs2_inum *i, void *inp);
extern void lgfs2_sb_in(struct gfs2_sbd *sdp, void *buf);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index a359f2fe..78b6812a 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -163,7 +163,7 @@ int lgfs2_rgrp_crc_check(char *buf)
return 0;
rg->rg_crc = 0;
- if (be32_to_cpu(crc) != gfs2_disk_hash(buf, sizeof(struct gfs2_rgrp)))
+ if (be32_to_cpu(crc) != lgfs2_disk_hash(buf, sizeof(struct gfs2_rgrp)))
ret = 1;
rg->rg_crc = crc;
return ret;
@@ -178,7 +178,7 @@ void lgfs2_rgrp_crc_set(char *buf)
uint32_t crc;
rg->rg_crc = 0;
- crc = gfs2_disk_hash(buf, sizeof(struct gfs2_rgrp));
+ crc = lgfs2_disk_hash(buf, sizeof(struct gfs2_rgrp));
rg->rg_crc = cpu_to_be32(crc);
}
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index fc0a59cc..a0de2477 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -81,7 +81,7 @@ uint32_t lgfs2_log_header_hash(char *buf)
/* lh_hash only CRCs the fields in the old lh, which ends where lh_crc is now */
const off_t v1_end = offsetof(struct gfs2_log_header, lh_hash) + 4;
- return gfs2_disk_hash(buf, v1_end);
+ return lgfs2_disk_hash(buf, v1_end);
}
uint32_t lgfs2_log_header_crc(char *buf, unsigned bsize)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.