Skip to contentSkip to conversation

erofs: get rid of the leftover PAGE_SIZE in dir.c

PATCH In review Gao Xiang 2 participants 2 messages Jun 19, 2022 – Jul 22, 2022 EROFS file system

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs: get rid of the leftover PAGE_SIZE in dir.c

Convert the last hardcoded PAGE_SIZEs of uncompressed cases.

---
 fs/erofs/dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/erofs/dir.c +2 -2
index 18e59821c597..723f5223a4fa 100644
@@ -90,7 +90,7 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
 
 		nameoff = le16_to_cpu(de->nameoff);
 		if (nameoff < sizeof(struct erofs_dirent) ||
-		    nameoff >= PAGE_SIZE) {
+		    nameoff >= EROFS_BLKSIZ) {
 			erofs_err(dir->i_sb,
 				  "invalid de[0].nameoff %u @ nid %llu",
 				  nameoff, EROFS_I(dir)->nid);
@@ -99,7 +99,7 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
 		}
 
 		maxsize = min_t(unsigned int,
-				dirsize - ctx->pos + ofs, PAGE_SIZE);
+				dirsize - ctx->pos + ofs, EROFS_BLKSIZ);
 
 		/* search dirents at the arbitrary position */
 		if (initial) {
Signature · 1 line
2.24.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Gao Xiang

Convert the last hardcoded PAGE_SIZEs of uncompressed cases.

---
 fs/erofs/dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/erofs/dir.c +1 -1
index 18e59821c597..723f5223a4fa 100644
@@ -90,7 +90,7 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
 
 		nameoff = le16_to_cpu(de->nameoff);
 		if (nameoff < sizeof(struct erofs_dirent) ||
-		    nameoff >= PAGE_SIZE) {
+		    nameoff >= EROFS_BLKSIZ) {
 			erofs_err(dir->i_sb,
 				  "invalid de[0].nameoff %u @ nid %llu",
 				  nameoff, EROFS_I(dir)->nid);

fs/erofs/dir.c static int erofs_readdir(struct file *f, struct dir_context *ctx) · line 105

Quoted 8 lines
fs/erofs/dir.c +1 -1
@@ -99,7 +99,7 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
 		}
 
 		maxsize = min_t(unsigned int,
-				dirsize - ctx->pos + ofs, PAGE_SIZE);
+				dirsize - ctx->pos + ofs, EROFS_BLKSIZ);
 
 		/* search dirents at the arbitrary position */
 		if (initial) {

LGTM.

Signature · 2 lines
Thanks,
Jeffle