* fhandler.cc (fhandler_base::write): Don't attempt to sparsify
an already sparse file. Drop check for FILE_SUPPORTS_SPARSE_FILES flag. Explicitely set FILE_ATTRIBUTE_SPARSE_FILE attribute in cached attributes. (fhandler_base::lseek): Only set did_lseek if sparseness is supported. * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Don't attempt to sparsify an already sparse file. Explicitely set FILE_ATTRIBUTE_SPARSE_FILE attribute in cached attributes. * mount.cc (oopt): Add "sparse" flag. (fillout_mntent): Ditto. * path.h (enum path_types): Add PATH_SPARSE. (path_conv::support_sparse): New method. (path_conv::fs_flags): Constify. (path_conv::fs_name_len): Ditto. include/sys/mount.h: Replace unused MOUNT_MIXED flag with MOUNT_SPARSE.
This commit is contained in:
@@ -1028,6 +1028,7 @@ struct opt
|
||||
{"override", MOUNT_OVERRIDE, 0},
|
||||
{"posix=0", MOUNT_NOPOSIX, 0},
|
||||
{"posix=1", MOUNT_NOPOSIX, 1},
|
||||
{"sparse", MOUNT_SPARSE, 0},
|
||||
{"text", MOUNT_BINARY, 1},
|
||||
{"user", MOUNT_SYSTEM, 1}
|
||||
};
|
||||
@@ -1667,6 +1668,9 @@ fillout_mntent (const char *native_path, const char *posix_path, unsigned flags)
|
||||
if (flags & MOUNT_NOPOSIX)
|
||||
strcat (_my_tls.locals.mnt_opts, (char *) ",posix=0");
|
||||
|
||||
if (flags & MOUNT_SPARSE)
|
||||
strcat (_my_tls.locals.mnt_opts, (char *) ",sparse");
|
||||
|
||||
if (!(flags & MOUNT_SYSTEM)) /* user mount */
|
||||
strcat (_my_tls.locals.mnt_opts, (char *) ",user");
|
||||
|
||||
|
Reference in New Issue
Block a user