Pull fscrypt updates from Eric Biggers: - Add the IV_INO_LBLK_32 encryption policy flag which modifies the encryption to be optimized for eMMC inline encryption hardware. - Make the test_dummy_encryption mount option for ext4 and f2fs support v2 encryption policies. - Fix kerneldoc warnings and some coding style inconsistencies. * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: add support for IV_INO_LBLK_32 policies fscrypt: make test_dummy_encryption use v2 by default fscrypt: support test_dummy_encryption=v2 fscrypt: add fscrypt_add_test_dummy_key() linux/parser.h: add include guards fscrypt: remove unnecessary extern keywords fscrypt: name all function parameters fscrypt: fix all kerneldoc warnings
Showing the changes to include/linux (2 of 18 files). Show all
Unified · Split
| @@ -15,12 +15,15 @@ · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/parser.h> | ||
| 18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 19 | #include <uapi/linux/fscrypt.h> | 20 | #include <uapi/linux/fscrypt.h> |
| 20 | 21 | ||
| 21 | #define FS_CRYPTO_BLOCK_SIZE 16 | 22 | #define FS_CRYPTO_BLOCK_SIZE 16 |
| 22 | 23 | ||
| 24 | union fscrypt_context; | ||
| 23 | struct fscrypt_info; | 25 | struct fscrypt_info; |
| 26 | struct seq_file; | ||
| 24 | 27 | ||
| 25 | struct fscrypt_str { | 28 | struct fscrypt_str { |
| 26 | unsigned char *name; | 29 | unsigned char *name; |
| @@ -56,10 +59,12 @@ struct fscrypt_name { · 29 unmodified lines | |||
| 56 | struct fscrypt_operations { | 59 | struct fscrypt_operations { |
| 57 | unsigned int flags; | 60 | unsigned int flags; |
| 58 | const char *key_prefix; | 61 | const char *key_prefix; |
| 59 | int (*get_context)(struct inode *, void *, size_t); | 62 | int (*get_context)(struct inode *inode, void *ctx, size_t len); |
| 60 | int (*set_context)(struct inode *, const void *, size_t, void *); | 63 | int (*set_context)(struct inode *inode, const void *ctx, size_t len, |
| 61 | bool (*dummy_context)(struct inode *); | 64 | void *fs_data); |
| 62 | bool (*empty_dir)(struct inode *); | 65 | const union fscrypt_context *(*get_dummy_context)( |
| 66 | struct super_block *sb); | ||
| 67 | bool (*empty_dir)(struct inode *inode); | ||
| 63 | unsigned int max_namelen; | 68 | unsigned int max_namelen; |
| 64 | bool (*has_stable_inodes)(struct super_block *sb); | 69 | bool (*has_stable_inodes)(struct super_block *sb); |
| 65 | void (*get_ino_and_lblk_bits)(struct super_block *sb, | 70 | void (*get_ino_and_lblk_bits)(struct super_block *sb, |
| @@ -75,6 +80,7 @@ static inline bool fscrypt_has_encryption_key(const struct inode *inode) · 9 unmodified lines | |||
| 75 | /** | 80 | /** |
| 76 | * fscrypt_needs_contents_encryption() - check whether an inode needs | 81 | * fscrypt_needs_contents_encryption() - check whether an inode needs |
| 77 | * contents encryption | 82 | * contents encryption |
| 83 | * @inode: the inode to check | ||
| 78 | * | 84 | * |
| 79 | * Return: %true iff the inode is an encrypted regular file and the kernel was | 85 | * Return: %true iff the inode is an encrypted regular file and the kernel was |
| 80 | * built with fscrypt support. | 86 | * built with fscrypt support. |
| @@ -87,10 +93,12 @@ static inline bool fscrypt_needs_contents_encryption(const struct inode *inode) · 6 unmodified lines | |||
| 87 | return IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode); | 93 | return IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode); |
| 88 | } | 94 | } |
| 89 | 95 | ||
| 90 | static inline bool fscrypt_dummy_context_enabled(struct inode *inode) | 96 | static inline const union fscrypt_context * |
| 97 | fscrypt_get_dummy_context(struct super_block *sb) | ||
| 91 | { | 98 | { |
| 92 | return inode->i_sb->s_cop->dummy_context && | 99 | if (!sb->s_cop->get_dummy_context) |
| 93 | inode->i_sb->s_cop->dummy_context(inode); | 100 | return NULL; |
| 101 | return sb->s_cop->get_dummy_context(sb); | ||
| 94 | } | 102 | } |
| 95 | 103 | ||
| 96 | /* | 104 | /* |
| @@ -106,22 +114,21 @@ static inline void fscrypt_handle_d_move(struct dentry *dentry) · 9 unmodified lines | |||
| 106 | } | 114 | } |
| 107 | 115 | ||
| 108 | /* crypto.c */ | 116 | /* crypto.c */ |
| 109 | extern void fscrypt_enqueue_decrypt_work(struct work_struct *); | 117 | void fscrypt_enqueue_decrypt_work(struct work_struct *); |
| 110 | 118 | ||
| 111 | extern struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, | 119 | struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, |
| 112 | unsigned int len, | 120 | unsigned int len, |
| 113 | unsigned int offs, | 121 | unsigned int offs, |
| 114 | gfp_t gfp_flags); | 122 | gfp_t gfp_flags); |
| 115 | extern int fscrypt_encrypt_block_inplace(const struct inode *inode, | 123 | int fscrypt_encrypt_block_inplace(const struct inode *inode, struct page *page, |
| 116 | struct page *page, unsigned int len, | 124 | unsigned int len, unsigned int offs, |
| 117 | unsigned int offs, u64 lblk_num, | 125 | u64 lblk_num, gfp_t gfp_flags); |
| 118 | gfp_t gfp_flags); | 126 | |
| 119 | 127 | int fscrypt_decrypt_pagecache_blocks(struct page *page, unsigned int len, | |
| 120 | extern int fscrypt_decrypt_pagecache_blocks(struct page *page, unsigned int len, | 128 | unsigned int offs); |
| 121 | unsigned int offs); | 129 | int fscrypt_decrypt_block_inplace(const struct inode *inode, struct page *page, |
| 122 | extern int fscrypt_decrypt_block_inplace(const struct inode *inode, | 130 | unsigned int len, unsigned int offs, |
| 123 | struct page *page, unsigned int len, | 131 | u64 lblk_num); |
| 124 | unsigned int offs, u64 lblk_num); | ||
| 125 | 132 | ||
| 126 | static inline bool fscrypt_is_bounce_page(struct page *page) | 133 | static inline bool fscrypt_is_bounce_page(struct page *page) |
| 127 | { | 134 | { |
| @@ -133,78 +140,90 @@ static inline struct page *fscrypt_pagecache_page(struct page *bounce_page) · 5 unmodified lines | |||
| 133 | return (struct page *)page_private(bounce_page); | 140 | return (struct page *)page_private(bounce_page); |
| 134 | } | 141 | } |
| 135 | 142 | ||
| 136 | extern void fscrypt_free_bounce_page(struct page *bounce_page); | 143 | void fscrypt_free_bounce_page(struct page *bounce_page); |
| 137 | 144 | ||
| 138 | /* policy.c */ | 145 | /* policy.c */ |
| 139 | extern int fscrypt_ioctl_set_policy(struct file *, const void __user *); | 146 | int fscrypt_ioctl_set_policy(struct file *filp, const void __user *arg); |
| 140 | extern int fscrypt_ioctl_get_policy(struct file *, void __user *); | 147 | int fscrypt_ioctl_get_policy(struct file *filp, void __user *arg); |
| 141 | extern int fscrypt_ioctl_get_policy_ex(struct file *, void __user *); | 148 | int fscrypt_ioctl_get_policy_ex(struct file *filp, void __user *arg); |
| 142 | extern int fscrypt_ioctl_get_nonce(struct file *filp, void __user *arg); | 149 | int fscrypt_ioctl_get_nonce(struct file *filp, void __user *arg); |
| 143 | extern int fscrypt_has_permitted_context(struct inode *, struct inode *); | 150 | int fscrypt_has_permitted_context(struct inode *parent, struct inode *child); |
| 144 | extern int fscrypt_inherit_context(struct inode *, struct inode *, | 151 | int fscrypt_inherit_context(struct inode *parent, struct inode *child, |
| 145 | void *, bool); | 152 | void *fs_data, bool preload); |
| 153 | |||
| 154 | struct fscrypt_dummy_context { | ||
| 155 | const union fscrypt_context *ctx; | ||
| 156 | }; | ||
| 157 | |||
| 158 | int fscrypt_set_test_dummy_encryption(struct super_block *sb, | ||
| 159 | const substring_t *arg, | ||
| 160 | struct fscrypt_dummy_context *dummy_ctx); | ||
| 161 | void fscrypt_show_test_dummy_encryption(struct seq_file *seq, char sep, | ||
| 162 | struct super_block *sb); | ||
| 163 | static inline void | ||
| 164 | fscrypt_free_dummy_context(struct fscrypt_dummy_context *dummy_ctx) | ||
| 165 | { | ||
| 166 | kfree(dummy_ctx->ctx); | ||
| 167 | dummy_ctx->ctx = NULL; | ||
| 168 | } | ||
| 169 | |||
| 146 | /* keyring.c */ | 170 | /* keyring.c */ |
| 147 | extern void fscrypt_sb_free(struct super_block *sb); | 171 | void fscrypt_sb_free(struct super_block *sb); |
| 148 | extern int fscrypt_ioctl_add_key(struct file *filp, void __user *arg); | 172 | int fscrypt_ioctl_add_key(struct file *filp, void __user *arg); |
| 149 | extern int fscrypt_ioctl_remove_key(struct file *filp, void __user *arg); | 173 | int fscrypt_ioctl_remove_key(struct file *filp, void __user *arg); |
| 150 | extern int fscrypt_ioctl_remove_key_all_users(struct file *filp, | 174 | int fscrypt_ioctl_remove_key_all_users(struct file *filp, void __user *arg); |
| 151 | void __user *arg); | 175 | int fscrypt_ioctl_get_key_status(struct file *filp, void __user *arg); |
| 152 | extern int fscrypt_ioctl_get_key_status(struct file *filp, void __user *arg); | ||
| 153 | 176 | ||
| 154 | /* keysetup.c */ | 177 | /* keysetup.c */ |
| 155 | extern int fscrypt_get_encryption_info(struct inode *); | 178 | int fscrypt_get_encryption_info(struct inode *inode); |
| 156 | extern void fscrypt_put_encryption_info(struct inode *); | 179 | void fscrypt_put_encryption_info(struct inode *inode); |
| 157 | extern void fscrypt_free_inode(struct inode *); | 180 | void fscrypt_free_inode(struct inode *inode); |
| 158 | extern int fscrypt_drop_inode(struct inode *inode); | 181 | int fscrypt_drop_inode(struct inode *inode); |
| 159 | 182 | ||
| 160 | /* fname.c */ | 183 | /* fname.c */ |
| 161 | extern int fscrypt_setup_filename(struct inode *, const struct qstr *, | 184 | int fscrypt_setup_filename(struct inode *inode, const struct qstr *iname, |
| 162 | int lookup, struct fscrypt_name *); | 185 | int lookup, struct fscrypt_name *fname); |
| 163 | 186 | ||
| 164 | static inline void fscrypt_free_filename(struct fscrypt_name *fname) | 187 | static inline void fscrypt_free_filename(struct fscrypt_name *fname) |
| 165 | { | 188 | { |
| 166 | kfree(fname->crypto_buf.name); | 189 | kfree(fname->crypto_buf.name); |
| 167 | } | 190 | } |
| 168 | 191 | ||
| 169 | extern int fscrypt_fname_alloc_buffer(const struct inode *, u32, | 192 | int fscrypt_fname_alloc_buffer(const struct inode *inode, u32 max_encrypted_len, |
| 170 | struct fscrypt_str *); | 193 | struct fscrypt_str *crypto_str); |
| 171 | extern void fscrypt_fname_free_buffer(struct fscrypt_str *); | 194 | void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str); |
| 172 | extern int fscrypt_fname_disk_to_usr(const struct inode *inode, | 195 | int fscrypt_fname_disk_to_usr(const struct inode *inode, |
| 173 | u32 hash, u32 minor_hash, | 196 | u32 hash, u32 minor_hash, |
| 174 | const struct fscrypt_str *iname, | 197 | const struct fscrypt_str *iname, |
| 175 | struct fscrypt_str *oname); | 198 | struct fscrypt_str *oname); |
| 176 | extern bool fscrypt_match_name(const struct fscrypt_name *fname, | 199 | bool fscrypt_match_name(const struct fscrypt_name *fname, |
| 177 | const u8 *de_name, u32 de_name_len); | 200 | const u8 *de_name, u32 de_name_len); |
| 178 | extern u64 fscrypt_fname_siphash(const struct inode *dir, | 201 | u64 fscrypt_fname_siphash(const struct inode *dir, const struct qstr *name); |
| 179 | const struct qstr *name); | ||
| 180 | 202 | ||
| 181 | /* bio.c */ | 203 | /* bio.c */ |
| 182 | extern void fscrypt_decrypt_bio(struct bio *); | 204 | void fscrypt_decrypt_bio(struct bio *bio); |
| 183 | extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t, | 205 | int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, |
| 184 | unsigned int); | 206 | sector_t pblk, unsigned int len); |
| 185 | 207 | ||
| 186 | /* hooks.c */ | 208 | /* hooks.c */ |
| 187 | extern int fscrypt_file_open(struct inode *inode, struct file *filp); | 209 | int fscrypt_file_open(struct inode *inode, struct file *filp); |
| 188 | extern int __fscrypt_prepare_link(struct inode *inode, struct inode *dir, | 210 | int __fscrypt_prepare_link(struct inode *inode, struct inode *dir, |
| 189 | struct dentry *dentry); | 211 | struct dentry *dentry); |
| 190 | extern int __fscrypt_prepare_rename(struct inode *old_dir, | 212 | int __fscrypt_prepare_rename(struct inode *old_dir, struct dentry *old_dentry, |
| 191 | struct dentry *old_dentry, | 213 | struct inode *new_dir, struct dentry *new_dentry, |
| 192 | struct inode *new_dir, | 214 | unsigned int flags); |
| 193 | struct dentry *new_dentry, | 215 | int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry, |
| 194 | unsigned int flags); | 216 | struct fscrypt_name *fname); |
| 195 | extern int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry, | 217 | int fscrypt_prepare_setflags(struct inode *inode, |
| 196 | struct fscrypt_name *fname); | 218 | unsigned int oldflags, unsigned int flags); |
| 197 | extern int fscrypt_prepare_setflags(struct inode *inode, | 219 | int __fscrypt_prepare_symlink(struct inode *dir, unsigned int len, |
| 198 | unsigned int oldflags, unsigned int flags); | 220 | unsigned int max_len, |
| 199 | extern int __fscrypt_prepare_symlink(struct inode *dir, unsigned int len, | 221 | struct fscrypt_str *disk_link); |
| 200 | unsigned int max_len, | 222 | int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, |
| 201 | struct fscrypt_str *disk_link); | 223 | unsigned int len, struct fscrypt_str *disk_link); |
| 202 | extern int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, | 224 | const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, |
| 203 | unsigned int len, | 225 | unsigned int max_size, |
| 204 | struct fscrypt_str *disk_link); | 226 | struct delayed_call *done); |
| 205 | extern const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, | ||
| 206 | unsigned int max_size, | ||
| 207 | struct delayed_call *done); | ||
| 208 | static inline void fscrypt_set_ops(struct super_block *sb, | 227 | static inline void fscrypt_set_ops(struct super_block *sb, |
| 209 | const struct fscrypt_operations *s_cop) | 228 | const struct fscrypt_operations *s_cop) |
| 210 | { | 229 | { |
| @@ -222,9 +241,10 @@ static inline bool fscrypt_needs_contents_encryption(const struct inode *inode) · 11 unmodified lines | |||
| 222 | return false; | 241 | return false; |
| 223 | } | 242 | } |
| 224 | 243 | ||
| 225 | static inline bool fscrypt_dummy_context_enabled(struct inode *inode) | 244 | static inline const union fscrypt_context * |
| 245 | fscrypt_get_dummy_context(struct super_block *sb) | ||
| 226 | { | 246 | { |
| 227 | return false; | 247 | return NULL; |
| 228 | } | 248 | } |
| 229 | 249 | ||
| 230 | static inline void fscrypt_handle_d_move(struct dentry *dentry) | 250 | static inline void fscrypt_handle_d_move(struct dentry *dentry) |
| @@ -319,6 +339,20 @@ static inline int fscrypt_inherit_context(struct inode *parent, · 88 unmodified lines | |||
| 319 | return -EOPNOTSUPP; | 339 | return -EOPNOTSUPP; |
| 320 | } | 340 | } |
| 321 | 341 | ||
| 342 | struct fscrypt_dummy_context { | ||
| 343 | }; | ||
| 344 | |||
| 345 | static inline void fscrypt_show_test_dummy_encryption(struct seq_file *seq, | ||
| 346 | char sep, | ||
| 347 | struct super_block *sb) | ||
| 348 | { | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline void | ||
| 352 | fscrypt_free_dummy_context(struct fscrypt_dummy_context *dummy_ctx) | ||
| 353 | { | ||
| 354 | } | ||
| 355 | |||
| 322 | /* keyring.c */ | 356 | /* keyring.c */ |
| 323 | static inline void fscrypt_sb_free(struct super_block *sb) | 357 | static inline void fscrypt_sb_free(struct super_block *sb) |
| 324 | { | 358 | { |
| @@ -504,7 +538,7 @@ static inline void fscrypt_set_ops(struct super_block *sb, · 179 unmodified lines | |||
| 504 | #endif /* !CONFIG_FS_ENCRYPTION */ | 538 | #endif /* !CONFIG_FS_ENCRYPTION */ |
| 505 | 539 | ||
| 506 | /** | 540 | /** |
| 507 | * fscrypt_require_key - require an inode's encryption key | 541 | * fscrypt_require_key() - require an inode's encryption key |
| 508 | * @inode: the inode we need the key for | 542 | * @inode: the inode we need the key for |
| 509 | * | 543 | * |
| 510 | * If the inode is encrypted, set up its encryption key if not already done. | 544 | * If the inode is encrypted, set up its encryption key if not already done. |
| @@ -530,7 +564,8 @@ static inline int fscrypt_require_key(struct inode *inode) · 19 unmodified lines | |||
| 530 | } | 564 | } |
| 531 | 565 | ||
| 532 | /** | 566 | /** |
| 533 | * fscrypt_prepare_link - prepare to link an inode into a possibly-encrypted directory | 567 | * fscrypt_prepare_link() - prepare to link an inode into a possibly-encrypted |
| 568 | * directory | ||
| 534 | * @old_dentry: an existing dentry for the inode being linked | 569 | * @old_dentry: an existing dentry for the inode being linked |
| 535 | * @dir: the target directory | 570 | * @dir: the target directory |
| 536 | * @dentry: negative dentry for the target filename | 571 | * @dentry: negative dentry for the target filename |
| @@ -557,7 +592,8 @@ static inline int fscrypt_prepare_link(struct dentry *old_dentry, · 20 unmodified lines | |||
| 557 | } | 592 | } |
| 558 | 593 | ||
| 559 | /** | 594 | /** |
| 560 | * fscrypt_prepare_rename - prepare for a rename between possibly-encrypted directories | 595 | * fscrypt_prepare_rename() - prepare for a rename between possibly-encrypted |
| 596 | * directories | ||
| 561 | * @old_dir: source directory | 597 | * @old_dir: source directory |
| 562 | * @old_dentry: dentry for source file | 598 | * @old_dentry: dentry for source file |
| 563 | * @new_dir: target directory | 599 | * @new_dir: target directory |
| @@ -590,7 +626,8 @@ static inline int fscrypt_prepare_rename(struct inode *old_dir, · 26 unmodified lines | |||
| 590 | } | 626 | } |
| 591 | 627 | ||
| 592 | /** | 628 | /** |
| 593 | * fscrypt_prepare_lookup - prepare to lookup a name in a possibly-encrypted directory | 629 | * fscrypt_prepare_lookup() - prepare to lookup a name in a possibly-encrypted |
| 630 | * directory | ||
| 594 | * @dir: directory being searched | 631 | * @dir: directory being searched |
| 595 | * @dentry: filename being looked up | 632 | * @dentry: filename being looked up |
| 596 | * @fname: (output) the name to use to search the on-disk directory | 633 | * @fname: (output) the name to use to search the on-disk directory |
| @@ -623,7 +660,8 @@ static inline int fscrypt_prepare_lookup(struct inode *dir, · 26 unmodified lines | |||
| 623 | } | 660 | } |
| 624 | 661 | ||
| 625 | /** | 662 | /** |
| 626 | * fscrypt_prepare_setattr - prepare to change a possibly-encrypted inode's attributes | 663 | * fscrypt_prepare_setattr() - prepare to change a possibly-encrypted inode's |
| 664 | * attributes | ||
| 627 | * @dentry: dentry through which the inode is being changed | 665 | * @dentry: dentry through which the inode is being changed |
| 628 | * @attr: attributes to change | 666 | * @attr: attributes to change |
| 629 | * | 667 | * |
| @@ -648,7 +686,7 @@ static inline int fscrypt_prepare_setattr(struct dentry *dentry, · 18 unmodified lines | |||
| 648 | } | 686 | } |
| 649 | 687 | ||
| 650 | /** | 688 | /** |
| 651 | * fscrypt_prepare_symlink - prepare to create a possibly-encrypted symlink | 689 | * fscrypt_prepare_symlink() - prepare to create a possibly-encrypted symlink |
| 652 | * @dir: directory in which the symlink is being created | 690 | * @dir: directory in which the symlink is being created |
| 653 | * @target: plaintext symlink target | 691 | * @target: plaintext symlink target |
| 654 | * @len: length of @target excluding null terminator | 692 | * @len: length of @target excluding null terminator |
| @@ -676,7 +714,7 @@ static inline int fscrypt_prepare_symlink(struct inode *dir, · 21 unmodified lines | |||
| 676 | unsigned int max_len, | 714 | unsigned int max_len, |
| 677 | struct fscrypt_str *disk_link) | 715 | struct fscrypt_str *disk_link) |
| 678 | { | 716 | { |
| 679 | if (IS_ENCRYPTED(dir) || fscrypt_dummy_context_enabled(dir)) | 717 | if (IS_ENCRYPTED(dir) || fscrypt_get_dummy_context(dir->i_sb) != NULL) |
| 680 | return __fscrypt_prepare_symlink(dir, len, max_len, disk_link); | 718 | return __fscrypt_prepare_symlink(dir, len, max_len, disk_link); |
| 681 | 719 | ||
| 682 | disk_link->name = (unsigned char *)target; | 720 | disk_link->name = (unsigned char *)target; |
| @@ -687,7 +725,7 @@ static inline int fscrypt_prepare_symlink(struct inode *dir, · 4 unmodified lines | |||
| 687 | } | 725 | } |
| 688 | 726 | ||
| 689 | /** | 727 | /** |
| 690 | * fscrypt_encrypt_symlink - encrypt the symlink target if needed | 728 | * fscrypt_encrypt_symlink() - encrypt the symlink target if needed |
| 691 | * @inode: symlink inode | 729 | * @inode: symlink inode |
| 692 | * @target: plaintext symlink target | 730 | * @target: plaintext symlink target |
| 693 | * @len: length of @target excluding null terminator | 731 | * @len: length of @target excluding null terminator |
| @@ -7,7 +7,8 @@ · 6 unmodified lines | |||
| 7 | * but could potentially be used anywhere else that simple option=arg | 7 | * but could potentially be used anywhere else that simple option=arg |
| 8 | * parsing is required. | 8 | * parsing is required. |
| 9 | */ | 9 | */ |
| 10 | 10 | #ifndef _LINUX_PARSER_H | |
| 11 | #define _LINUX_PARSER_H | ||
| 11 | 12 | ||
| 12 | /* associates an integer enumerator with a pattern string. */ | 13 | /* associates an integer enumerator with a pattern string. */ |
| 13 | struct match_token { | 14 | struct match_token { |
| @@ -34,3 +35,5 @@ int match_hex(substring_t *, int *result); · 20 unmodified lines | |||
| 34 | bool match_wildcard(const char *pattern, const char *str); | 35 | bool match_wildcard(const char *pattern, const char *str); |
| 35 | size_t match_strlcpy(char *, const substring_t *, size_t); | 36 | size_t match_strlcpy(char *, const substring_t *, size_t); |
| 36 | char *match_strdup(const substring_t *); | 37 | char *match_strdup(const substring_t *); |
| 38 | |||
| 39 | #endif /* _LINUX_PARSER_H */ | ||