The Samba-Bugzilla – Attachment 1262 Details for
Bug 2774
sparse file attribute not set when storing dos attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
set FILE_ATTRIBUTE_SPARSE
sparse-attr.diff (text/plain), 1.17 KB, created by
James Peach
on 2005-06-06 23:25:26 UTC
(
hide
)
Description:
set FILE_ATTRIBUTE_SPARSE
Filename:
MIME Type:
Creator:
James Peach
Created:
2005-06-06 23:25:26 UTC
Size:
1.17 KB
patch
obsolete
>Index: source/smbd/dosmode.c >=================================================================== >--- source/smbd/dosmode.c (revision 7349) >+++ source/smbd/dosmode.c (working copy) >@@ -20,6 +20,16 @@ > > #include "includes.h" > >+static inline void >+set_sparse_flag(const SMB_STRUCT_STAT * const sbuf, int * result) >+{ >+#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE) >+ if (sbuf->st_size > sbuf->st_blocks * (SMB_OFF_T)STAT_ST_BLOCKSIZE) { >+ *result |= FILE_ATTRIBUTE_SPARSE; >+ } >+#endif >+} >+ > /**************************************************************************** > Change a dos mode to a unix mode. > Base permission for files: >@@ -140,11 +150,7 @@ > if (S_ISDIR(sbuf->st_mode)) > result = aDIR | (result & aRONLY); > >-#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE) >- if (sbuf->st_size > sbuf->st_blocks * (SMB_OFF_T)STAT_ST_BLOCKSIZE) { >- result |= FILE_ATTRIBUTE_SPARSE; >- } >-#endif >+ set_sparse_flag(sbuf, &result); > > #ifdef S_ISLNK > #if LINKS_READ_ONLY >@@ -293,6 +299,7 @@ > > /* Get the DOS attributes from an EA by preference. */ > if (get_ea_dos_attribute(conn, path, sbuf, &result)) { >+ set_sparse_flag(sbuf, &result); > return result; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2774
: 1262