NOTE: this is linux only feature. Windows will ignore these ACLs.
If you don't know what Access Control Lists are, say N.
-
-config NTFS_FS
- tristate "NTFS file system support"
- select NTFS3_FS
- select BUFFER_HEAD
- select NLS
- help
- This config option is here only for backward compatibility. NTFS
- filesystem is now handled by the NTFS3 driver.
#endif
.setlease = generic_setlease,
};
-
-#if IS_ENABLED(CONFIG_NTFS_FS)
-const struct file_operations ntfs_legacy_dir_operations = {
- .llseek = generic_file_llseek,
- .read = generic_read_dir,
- .iterate_shared = ntfs_readdir,
- .open = ntfs_file_open,
- .setlease = generic_setlease,
-};
-#endif
// clang-format on
.release = ntfs_file_release,
.setlease = generic_setlease,
};
-
-#if IS_ENABLED(CONFIG_NTFS_FS)
-const struct file_operations ntfs_legacy_file_operations = {
- .llseek = generic_file_llseek,
- .read_iter = ntfs_file_read_iter,
- .splice_read = ntfs_file_splice_read,
- .open = ntfs_file_open,
- .release = ntfs_file_release,
- .setlease = generic_setlease,
-};
-#endif
// clang-format on
* Usually a hard links to directories are disabled.
*/
inode->i_op = &ntfs_dir_inode_operations;
- inode->i_fop = unlikely(is_legacy_ntfs(sb)) ?
- &ntfs_legacy_dir_operations :
- &ntfs_dir_operations;
+ inode->i_fop = &ntfs_dir_operations;
ni->i_valid = 0;
} else if (S_ISLNK(mode)) {
ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY;
} else if (S_ISREG(mode)) {
ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY;
inode->i_op = &ntfs_file_inode_operations;
- inode->i_fop = unlikely(is_legacy_ntfs(sb)) ?
- &ntfs_legacy_file_operations :
- &ntfs_file_operations;
+ inode->i_fop = &ntfs_file_operations;
inode->i_mapping->a_ops = is_compressed(ni) ? &ntfs_aops_cmpr :
&ntfs_aops;
if (ino != MFT_REC_MFT)
if (S_ISDIR(mode)) {
inode->i_op = &ntfs_dir_inode_operations;
- inode->i_fop = unlikely(is_legacy_ntfs(sb)) ?
- &ntfs_legacy_dir_operations :
- &ntfs_dir_operations;
+ inode->i_fop = &ntfs_dir_operations;
} else if (S_ISLNK(mode)) {
inode->i_op = &ntfs_link_inode_operations;
inode->i_fop = NULL;
inode_nohighmem(inode);
} else if (S_ISREG(mode)) {
inode->i_op = &ntfs_file_inode_operations;
- inode->i_fop = unlikely(is_legacy_ntfs(sb)) ?
- &ntfs_legacy_file_operations :
- &ntfs_file_operations;
+ inode->i_fop = &ntfs_file_operations;
inode->i_mapping->a_ops = is_compressed(ni) ? &ntfs_aops_cmpr :
&ntfs_aops;
init_rwsem(&ni->file.run_lock);
struct ntfs_fnd *fnd);
bool dir_is_empty(struct inode *dir);
extern const struct file_operations ntfs_dir_operations;
-extern const struct file_operations ntfs_legacy_dir_operations;
/* Globals from file.c */
int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,
extern const struct inode_operations ntfs_special_inode_operations;
extern const struct inode_operations ntfs_file_inode_operations;
extern const struct file_operations ntfs_file_operations;
-extern const struct file_operations ntfs_legacy_file_operations;
/* Globals from frecord.c */
void ni_remove_mi(struct ntfs_inode *ni, struct mft_inode *mi);
*var = cpu_to_le64(le64_to_cpu(*var) - val);
}
-#if IS_ENABLED(CONFIG_NTFS_FS)
-bool is_legacy_ntfs(struct super_block *sb);
-#else
-static inline bool is_legacy_ntfs(struct super_block *sb)
-{
- return false;
-}
-#endif
-
#endif /* _LINUX_NTFS3_NTFS_FS_H */
struct ntfs_mount_options *new_opts = fc->fs_private;
int ro_rw;
- /* If ntfs3 is used as legacy ntfs enforce read-only mode. */
- if (is_legacy_ntfs(sb)) {
- fc->sb_flags |= SB_RDONLY;
- goto out;
- }
-
ro_rw = sb_rdonly(sb) && !(fc->sb_flags & SB_RDONLY);
if (ro_rw && (sbi->flags & NTFS_FLAGS_NEED_REPLAY)) {
errorf(fc,
return -EINVAL;
}
-out:
sync_filesystem(sb);
swap(sbi->options, fc->fs_private);
ntfs_create_procdir(sb);
- if (is_legacy_ntfs(sb))
- sb->s_flags |= SB_RDONLY;
return 0;
put_inode_out:
* This will called when mount/remount. We will first initialize
* options so that if remount we can use just that.
*/
-static int __ntfs_init_fs_context(struct fs_context *fc)
+static int ntfs_init_fs_context(struct fs_context *fc)
{
struct ntfs_mount_options *opts;
struct ntfs_sb_info *sbi;
return -ENOMEM;
}
-static int ntfs_init_fs_context(struct fs_context *fc)
-{
- return __ntfs_init_fs_context(fc);
-}
-
static void ntfs3_kill_sb(struct super_block *sb)
{
struct ntfs_sb_info *sbi = sb->s_fs_info;
.fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
};
-#if IS_ENABLED(CONFIG_NTFS_FS)
-static int ntfs_legacy_init_fs_context(struct fs_context *fc)
-{
- int ret;
-
- ret = __ntfs_init_fs_context(fc);
- /* If ntfs3 is used as legacy ntfs enforce read-only mode. */
- fc->sb_flags |= SB_RDONLY;
- return ret;
-}
-
-static struct file_system_type ntfs_legacy_fs_type = {
- .owner = THIS_MODULE,
- .name = "ntfs",
- .init_fs_context = ntfs_legacy_init_fs_context,
- .parameters = ntfs_fs_parameters,
- .kill_sb = ntfs3_kill_sb,
- .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
-};
-MODULE_ALIAS_FS("ntfs");
-
-static inline void register_as_ntfs_legacy(void)
-{
- int err = register_filesystem(&ntfs_legacy_fs_type);
- if (err)
- pr_warn("ntfs3: Failed to register legacy ntfs filesystem driver: %d\n", err);
-}
-
-static inline void unregister_as_ntfs_legacy(void)
-{
- unregister_filesystem(&ntfs_legacy_fs_type);
-}
-bool is_legacy_ntfs(struct super_block *sb)
-{
- return sb->s_type == &ntfs_legacy_fs_type;
-}
-#else
-static inline void register_as_ntfs_legacy(void) {}
-static inline void unregister_as_ntfs_legacy(void) {}
-#endif
-
// clang-format on
static int __init init_ntfs_fs(void)
goto out1;
}
- register_as_ntfs_legacy();
err = register_filesystem(&ntfs_fs_type);
if (err)
goto out;
rcu_barrier();
kmem_cache_destroy(ntfs_inode_cachep);
unregister_filesystem(&ntfs_fs_type);
- unregister_as_ntfs_legacy();
ntfs3_exit_bitmap();
ntfs_remove_proc_root();
}