diff options
author | Jeremy Allison <jra@samba.org> | 2010-12-20 17:58:33 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-12-21 04:12:22 +0100 |
commit | 0a5f4f523fe3dcb90033ee53c838ad6030f608b4 (patch) | |
tree | e7bc21a1ab8d57241730a1601f6079948444e2d3 /source3/smbd/open.c | |
parent | 4820c97e9ea00e73f3188f9834a03913ed74df80 (diff) | |
download | samba-0a5f4f523fe3dcb90033ee53c838ad6030f608b4.tar.gz samba-0a5f4f523fe3dcb90033ee53c838ad6030f608b4.tar.bz2 samba-0a5f4f523fe3dcb90033ee53c838ad6030f608b4.zip |
Keep track of the sparse status of an open file handle. Allows bypass of
strict allocation on sparse files. Files opened as POSIX opens are always
sparse.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r-- | source3/smbd/open.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 80756d6641..32a08b5967 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2221,6 +2221,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } } + /* Determine sparse flag. */ + if (posix_open) { + /* POSIX opens are sparse by default. */ + fsp->is_sparse = true; + } else { + fsp->is_sparse = (file_existed && + (existing_dos_attributes & FILE_ATTRIBUTE_SPARSE)); + } + /* * Take care of inherited ACLs on created files - if default ACL not * selected. |