|
16 | 16 | * mi - MFT inode - One MFT record(usually 1024 bytes or 4K), consists of attributes. |
17 | 17 | * ni - NTFS inode - Extends linux inode. consists of one or more mft inodes. |
18 | 18 | * index - unit inside directory - 2K, 4K, <=page size, does not depend on cluster size. |
| 19 | + * resident attribute - Attribute with content stored directly in the MFT record |
| 20 | + * non-resident attribute - Attribute with content stored in clusters |
| 21 | + * data_size - Size of attribute content in bytes. Equal to inode->i_size |
| 22 | + * valid_size - Number of bytes written to the non-resident attribute |
| 23 | + * allocated_size - Total size of clusters allocated for non-resident content |
| 24 | + * total_size - Actual size of allocated clusters for sparse or compressed attributes |
| 25 | + * - Constraint: valid_size <= data_size <= allocated_size |
19 | 26 | * |
20 | 27 | * WSL - Windows Subsystem for Linux |
21 | 28 | * https://docs.microsoft.com/en-us/windows/wsl/file-permissions |
@@ -288,10 +295,8 @@ static const struct fs_parameter_spec ntfs_fs_parameters[] = { |
288 | 295 | /* |
289 | 296 | * Load nls table or if @nls is utf8 then return NULL. |
290 | 297 | * |
291 | | - * It is good idea to use here "const char *nls". |
292 | | - * But load_nls accepts "char*". |
293 | 298 | */ |
294 | | -static struct nls_table *ntfs_load_nls(char *nls) |
| 299 | +static struct nls_table *ntfs_load_nls(const char *nls) |
295 | 300 | { |
296 | 301 | struct nls_table *ret; |
297 | 302 |
|
@@ -566,10 +571,8 @@ static void ntfs_create_procdir(struct super_block *sb) |
566 | 571 | if (e) { |
567 | 572 | struct ntfs_sb_info *sbi = sb->s_fs_info; |
568 | 573 |
|
569 | | - proc_create_data("volinfo", 0444, e, |
570 | | - &ntfs3_volinfo_fops, sb); |
571 | | - proc_create_data("label", 0644, e, |
572 | | - &ntfs3_label_fops, sb); |
| 574 | + proc_create_data("volinfo", 0444, e, &ntfs3_volinfo_fops, sb); |
| 575 | + proc_create_data("label", 0644, e, &ntfs3_label_fops, sb); |
573 | 576 | sbi->procdir = e; |
574 | 577 | } |
575 | 578 | } |
@@ -600,10 +603,12 @@ static void ntfs_remove_proc_root(void) |
600 | 603 | } |
601 | 604 | } |
602 | 605 | #else |
603 | | -static void ntfs_create_procdir(struct super_block *sb) {} |
604 | | -static void ntfs_remove_procdir(struct super_block *sb) {} |
605 | | -static void ntfs_create_proc_root(void) {} |
606 | | -static void ntfs_remove_proc_root(void) {} |
| 606 | +// clang-format off |
| 607 | +static void ntfs_create_procdir(struct super_block *sb){} |
| 608 | +static void ntfs_remove_procdir(struct super_block *sb){} |
| 609 | +static void ntfs_create_proc_root(void){} |
| 610 | +static void ntfs_remove_proc_root(void){} |
| 611 | +// clang-format on |
607 | 612 | #endif |
608 | 613 |
|
609 | 614 | static struct kmem_cache *ntfs_inode_cachep; |
@@ -1223,8 +1228,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) |
1223 | 1228 | sb->s_export_op = &ntfs_export_ops; |
1224 | 1229 | sb->s_time_gran = NTFS_TIME_GRAN; // 100 nsec |
1225 | 1230 | sb->s_xattr = ntfs_xattr_handlers; |
1226 | | - if (options->nocase) |
1227 | | - set_default_d_op(sb, &ntfs_dentry_ops); |
| 1231 | + set_default_d_op(sb, options->nocase ? &ntfs_dentry_ops : NULL); |
1228 | 1232 |
|
1229 | 1233 | options->nls = ntfs_load_nls(options->nls_name); |
1230 | 1234 | if (IS_ERR(options->nls)) { |
@@ -1643,7 +1647,6 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) |
1643 | 1647 | out: |
1644 | 1648 | ntfs3_put_sbi(sbi); |
1645 | 1649 | kfree(boot2); |
1646 | | - ntfs3_put_sbi(sbi); |
1647 | 1650 | return err; |
1648 | 1651 | } |
1649 | 1652 |
|
|
0 commit comments