Unverified Commit 564c97bd authored by Kari Argillander's avatar Kari Argillander Committed by Konstantin Komarov
Browse files

fs/ntfs3: Convert mount options to pointer in sbi



Use pointer to mount options. We want to do this because we will use new
mount api which will benefit that we have spi and mount options in
different allocations. When we remount we do not have to make whole new
spi it is enough that we will allocate just mount options.

Please note that we can do example remount lot cleaner but things will
change in next patch so this should be just functional.

Signed-off-by: default avatarKari Argillander <kari.argillander@gmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent c2c389fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -529,7 +529,7 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
		} else if (pre_alloc == -1) {
			pre_alloc = 0;
			if (type == ATTR_DATA && !name_len &&
			    sbi->options.prealloc) {
			    sbi->options->prealloc) {
				CLST new_alen2 = bytes_to_cluster(
					sbi, get_pre_allocated(new_size));
				pre_alloc = new_alen2 - new_alen;
+4 −4
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ int ntfs_utf16_to_nls(struct ntfs_sb_info *sbi, const struct le_str *uni,
	int ret, uni_len, warn;
	const __le16 *ip;
	u8 *op;
	struct nls_table *nls = sbi->options.nls;
	struct nls_table *nls = sbi->options->nls;

	static_assert(sizeof(wchar_t) == sizeof(__le16));

@@ -186,7 +186,7 @@ int ntfs_nls_to_utf16(struct ntfs_sb_info *sbi, const u8 *name, u32 name_len,
{
	int ret, slen;
	const u8 *end;
	struct nls_table *nls = sbi->options.nls;
	struct nls_table *nls = sbi->options->nls;
	u16 *uname = uni->name;

	static_assert(sizeof(wchar_t) == sizeof(u16));
@@ -301,10 +301,10 @@ static inline int ntfs_filldir(struct ntfs_sb_info *sbi, struct ntfs_inode *ni,
		return 0;

	/* Skip meta files. Unless option to show metafiles is set. */
	if (!sbi->options.showmeta && ntfs_is_meta_file(sbi, ino))
	if (!sbi->options->showmeta && ntfs_is_meta_file(sbi, ino))
		return 0;

	if (sbi->options.nohidden && (fname->dup.fa & FILE_ATTRIBUTE_HIDDEN))
	if (sbi->options->nohidden && (fname->dup.fa & FILE_ATTRIBUTE_HIDDEN))
		return 0;

	name_len = ntfs_utf16_to_nls(sbi, (struct le_str *)&fname->name_len,
+2 −2
Original line number Diff line number Diff line
@@ -737,7 +737,7 @@ int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
	umode_t mode = inode->i_mode;
	int err;

	if (sbi->options.no_acs_rules) {
	if (sbi->options->no_acs_rules) {
		/* "No access rules" - Force any changes of time etc. */
		attr->ia_valid |= ATTR_FORCE;
		/* and disable for editing some attributes. */
@@ -1185,7 +1185,7 @@ static int ntfs_file_release(struct inode *inode, struct file *file)
	int err = 0;

	/* If we are last writer on the inode, drop the block reservation. */
	if (sbi->options.prealloc && ((file->f_mode & FMODE_WRITE) &&
	if (sbi->options->prealloc && ((file->f_mode & FMODE_WRITE) &&
				      atomic_read(&inode->i_writecount) == 1)) {
		ni_lock(ni);
		down_write(&ni->file.run_lock);
+6 −6
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@ static struct inode *ntfs_read_mft(struct inode *inode,

	inode->i_op = NULL;
	/* Setup 'uid' and 'gid' */
	inode->i_uid = sbi->options.fs_uid;
	inode->i_gid = sbi->options.fs_gid;
	inode->i_uid = sbi->options->fs_uid;
	inode->i_gid = sbi->options->fs_gid;

	err = mi_init(&ni->mi, sbi, ino);
	if (err)
@@ -229,7 +229,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
			t32 = le16_to_cpu(attr->nres.run_off);
		}

		mode = S_IFREG | (0777 & sbi->options.fs_fmask_inv);
		mode = S_IFREG | (0777 & sbi->options->fs_fmask_inv);

		if (!attr->non_res) {
			ni->ni_flags |= NI_FLAG_RESIDENT;
@@ -272,7 +272,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
			goto out;

		mode = sb->s_root
			       ? (S_IFDIR | (0777 & sbi->options.fs_dmask_inv))
			       ? (S_IFDIR | (0777 & sbi->options->fs_dmask_inv))
			       : (S_IFDIR | 0777);
		goto next_attr;

@@ -443,7 +443,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
		goto out;
	}

	if ((sbi->options.sys_immutable &&
	if ((sbi->options->sys_immutable &&
	     (std5->fa & FILE_ATTRIBUTE_SYSTEM)) &&
	    !S_ISFIFO(mode) && !S_ISSOCK(mode) && !S_ISLNK(mode)) {
		inode->i_flags |= S_IMMUTABLE;
@@ -1244,7 +1244,7 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns,
		 *	}
		 */
	} else if (S_ISREG(mode)) {
		if (sbi->options.sparse) {
		if (sbi->options->sparse) {
			/* Sparsed regular file, cause option 'sparse'. */
			fa = FILE_ATTRIBUTE_SPARSE_FILE |
			     FILE_ATTRIBUTE_ARCHIVE;
+1 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ struct ntfs_sb_info {
#endif
	} compress;

	struct ntfs_mount_options options;
	struct ntfs_mount_options *options;
	struct ratelimit_state msg_ratelimit;
};

Loading