Removed multiple patches (accepted upstream).

This commit is contained in:
Sebastian Lackner
2015-03-04 17:56:00 +01:00
parent 6b31c6f9e2
commit 4a8df258cd
11 changed files with 53 additions and 203 deletions

View File

@@ -8,7 +8,7 @@ Subject: ntdll: Use lockfree implementation for get_cached_fd. (try 5)
1 file changed, 69 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index aabda4f..be90cde 100644
index 69d01be..94d0544 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -75,6 +75,8 @@
@@ -20,7 +20,7 @@ index aabda4f..be90cde 100644
#include "wine/library.h"
#include "wine/server.h"
#include "wine/debug.h"
@@ -789,6 +791,7 @@ static int receive_fd( obj_handle_t *handle )
@@ -790,6 +792,7 @@ static int receive_fd( obj_handle_t *handle )
/***********************************************************************/
/* fd cache support */
@@ -28,7 +28,7 @@ index aabda4f..be90cde 100644
struct fd_cache_entry
{
int fd;
@@ -796,6 +799,7 @@ struct fd_cache_entry
@@ -797,6 +800,7 @@ struct fd_cache_entry
unsigned int access : 3;
unsigned int options : 24;
};
@@ -36,7 +36,7 @@ index aabda4f..be90cde 100644
#define FD_CACHE_BLOCK_SIZE (65536 / sizeof(struct fd_cache_entry))
#define FD_CACHE_ENTRIES 128
@@ -810,6 +814,36 @@ static inline unsigned int handle_to_index( HANDLE handle, unsigned int *entry )
@@ -811,6 +815,36 @@ static inline unsigned int handle_to_index( HANDLE handle, unsigned int *entry )
return idx % FD_CACHE_BLOCK_SIZE;
}
@@ -73,28 +73,18 @@ index aabda4f..be90cde 100644
/***********************************************************************
* add_fd_to_cache
@@ -820,7 +854,6 @@ static BOOL add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
unsigned int access, unsigned int options )
{
unsigned int entry, idx = handle_to_index( handle, &entry );
- int prev_fd;
if (entry >= FD_CACHE_ENTRIES)
{
@@ -839,12 +872,26 @@ static BOOL add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
@@ -839,12 +873,26 @@ static BOOL add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
fd_cache[entry] = ptr;
}
}
+
+#if defined(__powerpc__)
/* store fd+1 so that 0 can be used as the unset value */
- prev_fd = interlocked_xchg( &fd_cache[entry][idx].fd, fd + 1 ) - 1;
+ fd = interlocked_xchg( &fd_cache[entry][idx].fd, fd + 1 );
fd = interlocked_xchg( &fd_cache[entry][idx].fd, fd + 1 );
fd_cache[entry][idx].type = type;
fd_cache[entry][idx].access = access;
fd_cache[entry][idx].options = options;
- if (prev_fd != -1) close( prev_fd );
+ assert( !fd );
assert( !fd );
+#else
+ {
+ struct fd_cache_entry cache;
@@ -110,7 +100,7 @@ index aabda4f..be90cde 100644
return TRUE;
}
@@ -852,7 +899,7 @@ static BOOL add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
@@ -852,7 +900,7 @@ static BOOL add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
/***********************************************************************
* get_cached_fd
*
@@ -119,7 +109,7 @@ index aabda4f..be90cde 100644
*/
static inline int get_cached_fd( HANDLE handle, enum server_fd_type *type,
unsigned int *access, unsigned int *options )
@@ -862,10 +909,19 @@ static inline int get_cached_fd( HANDLE handle, enum server_fd_type *type,
@@ -862,10 +910,19 @@ static inline int get_cached_fd( HANDLE handle, enum server_fd_type *type,
if (entry < FD_CACHE_ENTRIES && fd_cache[entry])
{
@@ -139,7 +129,7 @@ index aabda4f..be90cde 100644
}
return fd;
}
@@ -903,6 +959,11 @@ int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd,
@@ -903,6 +960,11 @@ int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd,
*needs_close = 0;
wanted_access &= FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA;
@@ -151,7 +141,7 @@ index aabda4f..be90cde 100644
server_enter_uninterrupted_section( &fd_cache_section, &sigset );
fd = get_cached_fd( handle, type, &access, options );
@@ -930,6 +991,10 @@ int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd,
@@ -930,6 +992,10 @@ int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd,
done:
server_leave_uninterrupted_section( &fd_cache_section, &sigset );
@@ -162,6 +152,3 @@ index aabda4f..be90cde 100644
if (!ret && ((access & wanted_access) != wanted_access))
{
ret = STATUS_ACCESS_DENIED;
--
2.1.3