The Samba-Bugzilla – Attachment 6140 Details for
Bug 7815
sparse bit handling needs to be more windows-like
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0002-s3-remove-set_sparse_flag.patch
0002-s3-remove-set_sparse_flag.patch (text/plain), 2.15 KB, created by
Björn Jacke
on 2010-12-16 17:28:44 UTC
(
hide
)
Description:
0002-s3-remove-set_sparse_flag.patch
Filename:
MIME Type:
Creator:
Björn Jacke
Created:
2010-12-16 17:28:44 UTC
Size:
2.15 KB
patch
obsolete
>From 9c954aa8cef30441f0e411685383b9848264f596 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= <bj@sernet.de> >Date: Thu, 18 Nov 2010 17:03:01 +0100 >Subject: [PATCH 2/8] s3: remove set_sparse_flag > >we need to determine sparseness from the sparse flag we store not from the >allocation size on the POSIX filesystem. This is how Windows works - in the >first place sparseness is a file flag, not the allocation state of the file > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >--- > source3/smbd/dosmode.c | 16 +--------------- > 1 files changed, 1 insertions(+), 15 deletions(-) > >diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c >index ab0c238..2fafb15 100644 >--- a/source3/smbd/dosmode.c >+++ b/source3/smbd/dosmode.c >@@ -33,16 +33,6 @@ static uint32_t filter_mode_by_protocol(uint32_t mode) > return mode; > } > >-static int set_sparse_flag(const SMB_STRUCT_STAT * const sbuf) >-{ >-#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE) >- if (sbuf->st_ex_size > sbuf->st_ex_blocks * (SMB_OFF_T)STAT_ST_BLOCKSIZE) { >- return FILE_ATTRIBUTE_SPARSE; >- } >-#endif >- return 0; >-} >- > static int set_link_read_only_flag(const SMB_STRUCT_STAT *const sbuf) > { > #ifdef S_ISLNK >@@ -201,7 +191,6 @@ static uint32 dos_mode_from_sbuf(connection_struct *conn, > if (S_ISDIR(smb_fname->st.st_ex_mode)) > result = aDIR | (result & aRONLY); > >- result |= set_sparse_flag(&smb_fname->st); > result |= set_link_read_only_flag(&smb_fname->st); > > DEBUG(8,("dos_mode_from_sbuf returning ")); >@@ -560,7 +549,6 @@ static bool get_stat_dos_flags(connection_struct *conn, > if (S_ISDIR(smb_fname->st.st_ex_mode)) > *dosmode |= aDIR; > >- *dosmode |= set_sparse_flag(&smb_fname->st); > *dosmode |= set_link_read_only_flag(&smb_fname->st); > > return true; >@@ -653,9 +641,7 @@ uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname) > #endif > if (!used_stat_dos_flags) { > /* Get the DOS attributes from an EA by preference. */ >- if (get_ea_dos_attribute(conn, smb_fname, &result)) { >- result |= set_sparse_flag(&smb_fname->st); >- } else { >+ if (!get_ea_dos_attribute(conn, smb_fname, &result)) { > result |= dos_mode_from_sbuf(conn, smb_fname); > } > } >-- >1.7.3.1 >
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 7815
:
6139
| 6140 |
6141
|
6142
|
6143
|
6144
|
6145
|
6146
|
6147
|
6148
|
6149
|
6150
|
6155