~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/mf_iocache.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
Remove custom error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
  write buffer to the read buffer before we start to reuse it.
48
48
*/
49
49
 
50
 
#include <config.h>
 
50
#include "config.h"
51
51
 
52
 
#include <drizzled/internal/my_sys.h>
53
 
#include <drizzled/internal/m_string.h>
54
 
#include <drizzled/drizzled.h>
 
52
#include "drizzled/internal/my_sys.h"
 
53
#include "drizzled/internal/m_string.h"
 
54
#include "drizzled/drizzled.h"
55
55
#ifdef HAVE_AIOWAIT
56
 
#include <drizzled/error.h>
57
 
#include <drizzled/internal/aio_result.h>
 
56
#include "drizzled/error.h"
 
57
#include "drizzled/internal/aio_result.h"
58
58
static void my_aiowait(my_aio_result *result);
59
59
#endif
60
 
#include <drizzled/internal/iocache.h>
 
60
#include "drizzled/internal/iocache.h"
61
61
#include <errno.h>
62
62
#include <drizzled/util/test.h>
63
63
#include <stdlib.h>
70
70
namespace internal
71
71
{
72
72
 
73
 
static int _my_b_read(st_io_cache *info, unsigned char *Buffer, size_t Count);
74
 
static int _my_b_write(st_io_cache *info, const unsigned char *Buffer, size_t Count);
 
73
static int _my_b_read(register st_io_cache *info, unsigned char *Buffer, size_t Count);
 
74
static int _my_b_write(register st_io_cache *info, const unsigned char *Buffer, size_t Count);
75
75
 
76
76
/**
77
77
 * @brief
78
78
 *   Lock appends for the st_io_cache if required (need_append_buffer_lock)   
79
79
 */
80
80
inline
81
 
static void lock_append_buffer(st_io_cache *, int )
 
81
static void lock_append_buffer(register st_io_cache *, int )
82
82
{
83
83
}
84
84
 
87
87
 *   Unlock appends for the st_io_cache if required (need_append_buffer_lock)   
88
88
 */
89
89
inline
90
 
static void unlock_append_buffer(st_io_cache *, int )
 
90
static void unlock_append_buffer(register st_io_cache *, int )
91
91
{
92
92
}
93
93
 
441
441
 * @retval 0 We succeeded in reading all data
442
442
 * @retval 1 Error: can't read requested characters
443
443
 */
444
 
static int _my_b_read(st_io_cache *info, unsigned char *Buffer, size_t Count)
 
444
static int _my_b_read(register st_io_cache *info, unsigned char *Buffer, size_t Count)
445
445
{
446
446
  size_t length_local,diff_length,left_length, max_length;
447
447
  my_off_t pos_in_file_local;
552
552
 * @retval 0 Success
553
553
 * @retval 1 An error has occurred; st_io_cache to error state.
554
554
 */
555
 
int _my_b_async_read(st_io_cache *info, unsigned char *Buffer, size_t Count)
 
555
int _my_b_async_read(register st_io_cache *info, unsigned char *Buffer, size_t Count)
556
556
{
557
557
  size_t length_local,read_length,diff_length,left_length,use_length,org_Count;
558
558
  size_t max_length;
740
740
 * @retval 0 On success
741
741
 * @retval 1 On error on write
742
742
 */
743
 
int _my_b_write(st_io_cache *info, const unsigned char *Buffer, size_t Count)
 
743
int _my_b_write(register st_io_cache *info, const unsigned char *Buffer, size_t Count)
744
744
{
745
745
  size_t rest_length,length_local;
746
746
 
794
794
 *   As all write calls to the data goes through the cache,
795
795
 *   we will never get a seek over the end of the buffer.
796
796
 */
797
 
int my_block_write(st_io_cache *info, const unsigned char *Buffer, size_t Count,
 
797
int my_block_write(register st_io_cache *info, const unsigned char *Buffer, size_t Count,
798
798
                   my_off_t pos)
799
799
{
800
800
  size_t length_local;