summaryrefslogtreecommitdiffstats
path: root/fs/udf/udfdecl.h
diff options
context:
space:
mode:
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>2016-01-15 03:44:22 -0500
committerJan Kara <jack@suse.cz>2016-02-09 07:05:23 -0500
commit9293fcfbc1812a22ad5ce1b542eb90c1bbe01be1 (patch)
treeef5e96d406e9ac257911571591e0bcfb58afd9ad /fs/udf/udfdecl.h
parent066b9cded00b8e3212df74a417bb074f3f3a1fe0 (diff)
udf: Remove struct ustr as non-needed intermediate storage
Although 'struct ustr' tries to structurize the data by combining the string and its length, it doesn't actually make much benefit, since it saves only one parameter, but introduces an extra copying of the whole buffer, serving as an intermediate storage. It looks quite inefficient and not actually needed. This commit gets rid of the struct ustr by changing the parameters of some functions appropriately. Also, it removes using 'dstring' type, since it doesn't make much sense too. Just using the occasion, add a 'const' qualifier to udf_get_filename to make consistent parameters sets. 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.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 47a228248c5b..972b70625614 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -106,12 +106,6 @@ struct generic_desc {
106 __le32 volDescSeqNum; 106 __le32 volDescSeqNum;
107}; 107};
108 108
109struct ustr {
110 uint8_t u_cmpID;
111 uint8_t u_name[UDF_NAME_LEN];
112 uint8_t u_len;
113};
114
115 109
116/* super.c */ 110/* super.c */
117 111
@@ -214,12 +208,11 @@ udf_get_lb_pblock(struct super_block *sb, struct kernel_lb_addr *loc,
214} 208}
215 209
216/* unicode.c */ 210/* unicode.c */
217extern int udf_get_filename(struct super_block *, uint8_t *, int, uint8_t *, 211extern int udf_get_filename(struct super_block *, const uint8_t *, int,
218 int); 212 uint8_t *, int);
219extern int udf_put_filename(struct super_block *, const uint8_t *, int, 213extern int udf_put_filename(struct super_block *, const uint8_t *, int,
220 uint8_t *, int); 214 uint8_t *, int);
221extern int udf_build_ustr(struct ustr *, dstring *, int); 215extern int udf_CS0toUTF8(uint8_t *, int, const uint8_t *, int);
222extern int udf_CS0toUTF8(struct ustr *, const struct ustr *);
223 216
224/* ialloc.c */ 217/* ialloc.c */
225extern void udf_free_inode(struct inode *); 218extern void udf_free_inode(struct inode *);