summaryrefslogtreecommitdiffstats
path: root/fs/udf/udfdecl.h
diff options
context:
space:
mode:
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>2016-01-15 09:44:21 +0100
committerJan Kara <jack@suse.cz>2016-02-09 13:05:23 +0100
commit9fba70569d9c3c253dba10ebbe3359f2157e504c (patch)
tree2a6cd413e2c978a4217c9fe58afa2221199d5a3c /fs/udf/udfdecl.h
parentudf: Join functions for UTF8 and NLS conversions (diff)
downloadlinux-9fba70569d9c3c253dba10ebbe3359f2157e504c.tar.xz
linux-9fba70569d9c3c253dba10ebbe3359f2157e504c.zip
udf: Adjust UDF_NAME_LEN to better reflect actual restrictions
Actual name length restriction is 254 bytes, this is used in 'ustr' structure, and this is what fits into UDF File Ident structures. And in most cases the constant is used as UDF_NAME_LEN-2. So, it's better to just modify the constant to make it closer to reality. Also, in some cases it's useful to have a separate constant for the maximum length of file name field in CS0 encoding in UDF File Ident structures. Also, remove the unused UDF_PATH_LEN constant. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/udfdecl.h')
-rw-r--r--fs/udf/udfdecl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 4a47c7267614..47a228248c5b 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -49,8 +49,8 @@ extern __printf(3, 4) void _udf_warn(struct super_block *sb,
#define UDF_EXTENT_FLAG_MASK 0xC0000000
#define UDF_NAME_PAD 4
-#define UDF_NAME_LEN 256
-#define UDF_PATH_LEN 1023
+#define UDF_NAME_LEN 254
+#define UDF_NAME_LEN_CS0 255
static inline size_t udf_file_entry_alloc_offset(struct inode *inode)
{
@@ -108,7 +108,7 @@ struct generic_desc {
struct ustr {
uint8_t u_cmpID;
- uint8_t u_name[UDF_NAME_LEN - 2];
+ uint8_t u_name[UDF_NAME_LEN];
uint8_t u_len;
};