diff options
author | Jan Kara <jack@suse.cz> | 2021-05-03 11:54:24 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2021-08-11 16:54:44 +0200 |
commit | 979a6e28dd969a2222545001f79566b4bfaf06c0 (patch) | |
tree | 2f84f4228fa2b68b9e108a0031e3bca1f83bba65 /fs/udf/dir.c | |
parent | b3c8c9801eb9b8e0f73246b4b14efbde1a4c570c (diff) | |
download | lwn-979a6e28dd969a2222545001f79566b4bfaf06c0.tar.gz lwn-979a6e28dd969a2222545001f79566b4bfaf06c0.zip |
udf: Get rid of 0-length arrays in struct fileIdentDesc
Get rid of 0-length arrays in struct fileIdentDesc. This requires a bit
of cleaning up as the second variable length array in this structure is
often used and the code abuses the fact that the first two arrays have
the same type and offset in struct fileIdentDesc.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/dir.c')
-rw-r--r-- | fs/udf/dir.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/udf/dir.c b/fs/udf/dir.c index c19dba45aa20..70abdfad2df1 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -35,7 +35,6 @@ #include "udf_i.h" #include "udf_sb.h" - static int udf_readdir(struct file *file, struct dir_context *ctx) { struct inode *dir = file_inode(file); @@ -135,7 +134,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx) lfi = cfi.lengthFileIdent; if (fibh.sbh == fibh.ebh) { - nameptr = fi->fileIdent + liu; + nameptr = udf_get_fi_ident(fi); } else { int poffset; /* Unpaded ending offset */ @@ -153,7 +152,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx) } } nameptr = copy_name; - memcpy(nameptr, fi->fileIdent + liu, + memcpy(nameptr, udf_get_fi_ident(fi), lfi - poffset); memcpy(nameptr + lfi - poffset, fibh.ebh->b_data, poffset); |