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

Commit 99634bf3 authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman
Browse files

erofs: add "erofs_" prefix for common and short functions

parent 94e4e153
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@


#include <trace/events/erofs.h>
#include <trace/events/erofs.h>


static inline void read_endio(struct bio *bio)
static void erofs_readendio(struct bio *bio)
{
{
	struct super_block *const sb = bio->bi_private;
	struct super_block *const sb = bio->bi_private;
	struct bio_vec *bvec;
	struct bio_vec *bvec;
@@ -45,7 +45,7 @@ static struct bio *erofs_grab_raw_bio(struct super_block *sb,
{
{
	struct bio *bio = bio_alloc(GFP_NOIO, nr_pages);
	struct bio *bio = bio_alloc(GFP_NOIO, nr_pages);


	bio->bi_end_io = read_endio;
	bio->bi_end_io = erofs_readendio;
	bio_set_dev(bio, sb->s_bdev);
	bio_set_dev(bio, sb->s_bdev);
	bio->bi_iter.bi_sector = (sector_t)blkaddr << LOG_SECTORS_PER_BLOCK;
	bio->bi_iter.bi_sector = (sector_t)blkaddr << LOG_SECTORS_PER_BLOCK;
	bio->bi_private = sb;
	bio->bi_private = sb;
+11 −11
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ static bool use_vmap;
module_param(use_vmap, bool, 0444);
module_param(use_vmap, bool, 0444);
MODULE_PARM_DESC(use_vmap, "Use vmap() instead of vm_map_ram() (default 0)");
MODULE_PARM_DESC(use_vmap, "Use vmap() instead of vm_map_ram() (default 0)");


static int lz4_prepare_destpages(struct z_erofs_decompress_req *rq,
static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq,
					 struct list_head *pagepool)
					 struct list_head *pagepool)
{
{
	const unsigned int nr =
	const unsigned int nr =
@@ -114,7 +114,7 @@ static void *generic_copy_inplace_data(struct z_erofs_decompress_req *rq,
	return tmp;
	return tmp;
}
}


static int lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out)
static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out)
{
{
	unsigned int inputmargin, inlen;
	unsigned int inputmargin, inlen;
	u8 *src;
	u8 *src;
@@ -188,8 +188,8 @@ static struct z_erofs_decompressor decompressors[] = {
		.name = "shifted"
		.name = "shifted"
	},
	},
	[Z_EROFS_COMPRESSION_LZ4] = {
	[Z_EROFS_COMPRESSION_LZ4] = {
		.prepare_destpages = lz4_prepare_destpages,
		.prepare_destpages = z_erofs_lz4_prepare_destpages,
		.decompress = lz4_decompress,
		.decompress = z_erofs_lz4_decompress,
		.name = "lz4"
		.name = "lz4"
	},
	},
};
};
@@ -247,7 +247,7 @@ static void erofs_vunmap(const void *mem, unsigned int count)
		vunmap(mem);
		vunmap(mem);
}
}


static int decompress_generic(struct z_erofs_decompress_req *rq,
static int z_erofs_decompress_generic(struct z_erofs_decompress_req *rq,
				      struct list_head *pagepool)
				      struct list_head *pagepool)
{
{
	const unsigned int nrpages_out =
	const unsigned int nrpages_out =
@@ -308,7 +308,7 @@ static int decompress_generic(struct z_erofs_decompress_req *rq,
	return ret;
	return ret;
}
}


static int shifted_decompress(const struct z_erofs_decompress_req *rq,
static int z_erofs_shifted_transform(const struct z_erofs_decompress_req *rq,
				     struct list_head *pagepool)
				     struct list_head *pagepool)
{
{
	const unsigned int nrpages_out =
	const unsigned int nrpages_out =
@@ -353,7 +353,7 @@ int z_erofs_decompress(struct z_erofs_decompress_req *rq,
		       struct list_head *pagepool)
		       struct list_head *pagepool)
{
{
	if (rq->alg == Z_EROFS_COMPRESSION_SHIFTED)
	if (rq->alg == Z_EROFS_COMPRESSION_SHIFTED)
		return shifted_decompress(rq, pagepool);
		return z_erofs_shifted_transform(rq, pagepool);
	return decompress_generic(rq, pagepool);
	return z_erofs_decompress_generic(rq, pagepool);
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@
#include <trace/events/erofs.h>
#include <trace/events/erofs.h>


/* no locking */
/* no locking */
static int read_inode(struct inode *inode, void *data)
static int erofs_read_inode(struct inode *inode, void *data)
{
{
	struct erofs_inode *vi = EROFS_I(inode);
	struct erofs_inode *vi = EROFS_I(inode);
	struct erofs_inode_compact *dic = data;
	struct erofs_inode_compact *dic = data;
@@ -163,7 +163,7 @@ static int erofs_fill_symlink(struct inode *inode, void *data,
	return 0;
	return 0;
}
}


static int fill_inode(struct inode *inode, int isdir)
static int erofs_fill_inode(struct inode *inode, int isdir)
{
{
	struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
	struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
	struct erofs_inode *vi = EROFS_I(inode);
	struct erofs_inode *vi = EROFS_I(inode);
@@ -193,7 +193,7 @@ static int fill_inode(struct inode *inode, int isdir)
	DBG_BUGON(!PageUptodate(page));
	DBG_BUGON(!PageUptodate(page));
	data = page_address(page);
	data = page_address(page);


	err = read_inode(inode, data + ofs);
	err = erofs_read_inode(inode, data + ofs);
	if (!err) {
	if (!err) {
		/* setup the new inode */
		/* setup the new inode */
		switch (inode->i_mode & S_IFMT) {
		switch (inode->i_mode & S_IFMT) {
@@ -286,7 +286,7 @@ struct inode *erofs_iget(struct super_block *sb,


		vi->nid = nid;
		vi->nid = nid;


		err = fill_inode(inode, isdir);
		err = erofs_fill_inode(inode, isdir);
		if (!err)
		if (!err)
			unlock_new_inode(inode);
			unlock_new_inode(inode);
		else {
		else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -308,7 +308,7 @@ struct erofs_inode {
#define EROFS_I(ptr)	\
#define EROFS_I(ptr)	\
	container_of(ptr, struct erofs_inode, vfs_inode)
	container_of(ptr, struct erofs_inode, vfs_inode)


static inline unsigned long inode_datablocks(struct inode *inode)
static inline unsigned long erofs_inode_datablocks(struct inode *inode)
{
{
	/* since i_size cannot be changed */
	/* since i_size cannot be changed */
	return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ);
	return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ);
+6 −6
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@ struct erofs_qstr {
};
};


/* based on the end of qn is accurate and it must have the trailing '\0' */
/* based on the end of qn is accurate and it must have the trailing '\0' */
static inline int dirnamecmp(const struct erofs_qstr *qn,
static inline int erofs_dirnamecmp(const struct erofs_qstr *qn,
				   const struct erofs_qstr *qd,
				   const struct erofs_qstr *qd,
				   unsigned int *matched)
				   unsigned int *matched)
{
{
@@ -71,7 +71,7 @@ static struct erofs_dirent *find_target_dirent(struct erofs_qstr *name,
		};
		};


		/* string comparison without already matched prefix */
		/* string comparison without already matched prefix */
		int ret = dirnamecmp(name, &dname, &matched);
		int ret = erofs_dirnamecmp(name, &dname, &matched);


		if (!ret) {
		if (!ret) {
			return de + mid;
			return de + mid;
@@ -98,7 +98,7 @@ static struct page *find_target_block_classic(struct inode *dir,


	startprfx = endprfx = 0;
	startprfx = endprfx = 0;
	head = 0;
	head = 0;
	back = inode_datablocks(dir) - 1;
	back = erofs_inode_datablocks(dir) - 1;


	while (head <= back) {
	while (head <= back) {
		const int mid = head + (back - head) / 2;
		const int mid = head + (back - head) / 2;
@@ -134,7 +134,7 @@ static struct page *find_target_block_classic(struct inode *dir,
							  EROFS_BLKSIZ);
							  EROFS_BLKSIZ);


			/* string comparison without already matched prefix */
			/* string comparison without already matched prefix */
			diff = dirnamecmp(name, &dname, &matched);
			diff = erofs_dirnamecmp(name, &dname, &matched);
			kunmap_atomic(de);
			kunmap_atomic(de);


			if (!diff) {
			if (!diff) {
Loading