Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c002f425 authored by Anton Altaparmakov's avatar Anton Altaparmakov
Browse files

NTFS: - Add disable_sparse mount option together with a per volume sparse


	enable bit which is set appropriately and a per inode sparse disable
	bit which is preset on some system file inodes as appropriate.
      - Enforce that sparse support is disabled on NTFS volumes pre 3.0.

Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent f40661be
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -149,6 +149,13 @@ case_sensitive=<BOOL> If case_sensitive is specified, treat all file names as
			name, if it exists.  If case_sensitive, you will need
			to provide the correct case of the short file name.

disable_sparse=<BOOL>	If disable_sparse is specified, creation of sparse
			regions, i.e. holes, inside files is disabled for the
			volume (for the duration of this mount only).  By
			default, creation of sparse regions is enabled, which
			is consistent with the behaviour of traditional Unix
			filesystems.

errors=opt		What to do when critical filesystem errors are found.
			Following values can be used for "opt":
			  continue: DEFAULT, try to clean-up as much as
+7 −3
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@ ToDo/Notes:
	  this only works until the data attribute becomes too big for the mft
	  record after which we abort the write returning -EOPNOTSUPP from
	  ntfs_prepare_write().
	- Add disable_sparse mount option together with a per volume sparse
	  enable bit which is set appropriately and a per inode sparse disable
	  bit which is preset on some system file inodes as appropriate.
	- Enforce that sparse support is disabled on NTFS volumes pre 3.0.

2.1.22 - Many bug and race fixes and error handling improvements.

+2 −2
Original line number Diff line number Diff line
/**
 * dir.c - NTFS kernel directory operations. Part of the Linux-NTFS project.
 *
 * Copyright (c) 2001-2004 Anton Altaparmakov
 * Copyright (c) 2001-2005 Anton Altaparmakov
 * Copyright (c) 2002 Richard Russon
 *
 * This program/include file is free software; you can redistribute it and/or
+4 −1
Original line number Diff line number Diff line
/**
 * inode.c - NTFS kernel inode handling. Part of the Linux-NTFS project.
 *
 * Copyright (c) 2001-2004 Anton Altaparmakov
 * Copyright (c) 2001-2005 Anton Altaparmakov
 *
 * This program/include file is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published
@@ -1731,6 +1731,7 @@ int ntfs_read_inode_mount(struct inode *vi)
	/* Setup the data attribute. It is special as it is mst protected. */
	NInoSetNonResident(ni);
	NInoSetMstProtected(ni);
	NInoSetSparseDisabled(ni);
	ni->type = AT_DATA;
	ni->name = NULL;
	ni->name_len = 0;
@@ -2279,6 +2280,8 @@ int ntfs_show_options(struct seq_file *sf, struct vfsmount *mnt)
		seq_printf(sf, ",case_sensitive");
	if (NVolShowSystemFiles(vol))
		seq_printf(sf, ",show_sys_files");
	if (!NVolSparseEnabled(vol))
		seq_printf(sf, ",disable_sparse");
	for (i = 0; on_errors_arr[i].val; i++) {
		if (on_errors_arr[i].val & vol->on_errors)
			seq_printf(sf, ",errors=%s", on_errors_arr[i].str);
+3 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * inode.h - Defines for inode structures NTFS Linux kernel driver. Part of
 *	     the Linux-NTFS project.
 *
 * Copyright (c) 2001-2004 Anton Altaparmakov
 * Copyright (c) 2001-2005 Anton Altaparmakov
 * Copyright (c) 2002 Richard Russon
 *
 * This program/include file is free software; you can redistribute it and/or
@@ -166,6 +166,7 @@ typedef enum {
	NI_Sparse,		/* 1: Unnamed data attr is sparse (f).
				   1: Create sparse files by default (d).
				   1: Attribute is sparse (a). */
	NI_SparseDisabled,	/* 1: May not create sparse regions. */
	NI_TruncateFailed,	/* 1: Last ntfs_truncate() call failed. */
} ntfs_inode_state_bits;

@@ -218,6 +219,7 @@ NINO_FNS(IndexAllocPresent)
NINO_FNS(Compressed)
NINO_FNS(Encrypted)
NINO_FNS(Sparse)
NINO_FNS(SparseDisabled)
NINO_FNS(TruncateFailed)

/*
Loading