Changeset 656


Ignore:
Timestamp:
Nov 8, 2011, 6:50:31 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba Server 3.5: Some more work to get high-mem working

Location:
trunk/server
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/tdb/common/tdb_private.h

    r456 r656  
    3838#include "tdb.h"
    3939
    40 /* #define TDB_TRACE 1 */
     40#define TDB_TRACE 1
    4141#ifndef HAVE_GETPAGESIZE
    4242#define getpagesize() 0x2000
  • trunk/server/lib/tdb/common/transaction.c

    r456 r656  
    10201020
    10211021        tdb_trace(tdb, "tdb_transaction_commit");
    1022 
     1022        tdb_trace(tdb, "@todo: tdb_transaction_error");
    10231023        if (tdb->transaction->transaction_error) {
    10241024                tdb->ecode = TDB_ERR_IO;
     
    10281028        }
    10291029
    1030 
     1030        tdb_trace(tdb, "@todo: tdb_transaction_nesting");
    10311031        if (tdb->transaction->nesting != 0) {
    10321032                tdb->transaction->nesting--;
     
    10341034        }
    10351035
     1036        tdb_trace(tdb, "@todo: tdb_null_transaction");
    10361037        /* check for a null transaction */
    10371038        if (tdb->transaction->blocks == NULL) {
     
    10401041        }
    10411042
     1043        tdb_trace(tdb, "@todo: tdb_transaction_prepare");
    10421044        if (!tdb->transaction->prepared) {
    10431045                int ret = _tdb_transaction_prepare_commit(tdb);
     
    10481050        methods = tdb->transaction->io_methods;
    10491051
     1052        tdb_trace(tdb, "@todo: tdb_transaction perform all the writes");
     1053
    10501054        /* perform all the writes */
    10511055        for (i=0;i<tdb->transaction->num_blocks;i++) {
     
    10621066                        length = tdb->transaction->last_block_size;
    10631067                }
    1064 
    10651068                if (methods->tdb_write(tdb, offset, tdb->transaction->blocks[i], length) == -1) {
    10661069                        TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_commit: write failed during commit\n"));
     
    10831086        tdb->transaction->num_blocks = 0;
    10841087
     1088        tdb_trace(tdb, "@todo: tdb_transaction ensure the new data is on disk");
    10851089        /* ensure the new data is on disk */
    10861090        if (transaction_sync(tdb, 0, tdb->map_size) == -1) {
     
    11001104           mtime changes when a transaction completes */
    11011105#ifdef HAVE_UTIME
     1106    tdb_trace(tdb, "@todo: tdb_transaction utime");
    11021107        utime(tdb->name, NULL);
    11031108#endif
    11041109
     1110    tdb_trace(tdb, "@todo: tdb_transaction need repack");
    11051111        need_repack = tdb->transaction->need_repack;
    11061112
    11071113        /* use a transaction cancel to free memory and remove the
    11081114           transaction locks */
     1115    tdb_trace(tdb, "@todo: tdb_transaction cancel");
    11091116        _tdb_transaction_cancel(tdb);
    11101117
    11111118        if (need_repack) {
     1119            tdb_trace(tdb, "@todo: tdb_transaction repack");
    11121120                return tdb_repack(tdb);
    11131121        }
  • trunk/server/source3/build.cmd

    r604 r656  
    77/* version 0.3.1 from 20.08.2010 Silvan (added version.ecs check) */
    88/* version 0.3.2 from 08.07.2011 Silvan (pythonhome may be not set) */
     9/* version 0.3.3 from 05.11.2011 Herwig (add support for libc064) */
    910
    1011/* load the sysfuncs if not already loaded */
     
    1617
    1718/* init the version string (don't forget to change) */
    18 version = "0.3.2"
    19 version_date = "08.07.2011"
    20 
     19version = "0.3.3"
     20version_date = "05.11.2011"
    2121
    2222'@echo off'
     
    2424
    2525say "Samba for eCS (OS/2) build script v"   || version || " from " || version_date
    26 
    2726
    2827/* No parameter or HELP -> display usage */
     
    3130    say "Valid commands are:"
    3231    say "      HELP  - this page"
     32    say "      064   - link against libc064.dll (default)"
     33    say "      064x  - link against libc064x.dll"
    3334    say "      063   - link against libc063.dll"
    34     say "      064x  - link against libc064x.dll"
    3535    say "      CONF  - run configure"
    3636    say "      CLEAN - clean up and recompile everything"
     
    5555/* defaults */
    5656make  = ""
    57 libc  = "064x"
     57libc  = "064"
    5858brand = "No"
    5959conf  = ""
     
    8383    build_parms = build_parms||' 'make
    8484end
    85 if pos("064X", cmdline) > 0 then do
    86     libc = "064X"
    87     build_parms = build_parms||' 'libc   
    88 end
    89 if pos("063", cmdline) > 0 then do
    90     libc = "063"
    91     build_parms = build_parms||' 'libc   
     85select
     86    when pos("064X", cmdline) > 0 then do
     87        libc = "064X"
     88        build_parms = build_parms||' 'libc   
     89    end
     90    when pos("063", cmdline) > 0 then do
     91        libc = "063"
     92        build_parms = build_parms||' 'libc   
     93    end
     94    otherwise do
     95        libc = "064"
     96        build_parms = build_parms||' 'libc   
     97    end
    9298end
    9399if pos("BRAND", cmdline) > 0 then do
     
    101107
    102108/* start working */
    103 if libc = "063" then do
    104     address cmd "call 063.cmd"
    105 end
    106 else do
    107     address cmd "call 064x.cmd"
     109select
     110    when libc = "064X" then address cmd "call 064x.cmd"
     111    when libc = "063" then address cmd "call 063.cmd"
     112    otherwise address cmd "call 064.cmd"
    108113end
    109114
     
    123128
    124129/* is cups env set */
    125         sEnvVar = EnvGet('CUPS');
     130    sEnvVar = EnvGet('CUPS');
    126131    if sEnvVar <> '' then do
    127     call lineout cacheFile, "ac_cv_path_CUPS_CONFIG='" || sEnvVar || "'";
     132        call lineout cacheFile, "ac_cv_path_CUPS_CONFIG='" || sEnvVar || "'";
    128133    end
    129134
    130135/* is python env set */
    131         sEnvVar = EnvGet('PYTHONHOME');
     136    sEnvVar = EnvGet('PYTHONHOME');
    132137    if sEnvVar <> '' then do
    133     sPythonVersion = PythonVersion(sEnvVar);
    134     if sPythonVersion <> '-1' then do
    135     call lineout cacheFile, "ac_cv_path_PYTHON_CONFIG='" || sEnvVar || "/config/" || sPythonVersion || "'";
    136     call lineout cacheFile, "ac_cv_path_PYTHON='" || sEnvVar || "'";
    137     end
     138        sPythonVersion = PythonVersion(sEnvVar);
     139        if sPythonVersion <> '-1' then do
     140            call lineout cacheFile, "ac_cv_path_PYTHON_CONFIG='" || sEnvVar || "/config/" || sPythonVersion || "'";
     141            call lineout cacheFile, "ac_cv_path_PYTHON='" || sEnvVar || "'";
     142        end
    138143    end
    139144
     
    148153    address cmd "make clean"
    149154end
    150        
     155
    151156if brand = "YES" then do
    152157    svninfo = ".\svninfo"
     
    160165    say build_parms
    161166    address cmd 'make 2>&1 | tee build.log'
    162 end   
     167end
    163168
    164169if pos("ZIP", cmdline) > 0 then do
  • trunk/server/source3/lib/os2helper.c

    r655 r656  
    1 /* This file contains helper functions for OS/2 -
    2    do not try to compile on other platforms! */
     1/*  This file contains Samba helper functions for eComStation (OS/2) -
     2 *  do not try to compile on other platforms!
     3 * 
     4 *  Copyright (C) 2007-2011
     5 *                Silvan Scherrer
     6 *                Yuri Dario
     7 *                Paul Smedley
     8 *
     9 *  This program is free software; you can redistribute it and/or modify
     10 *  it under the terms of the GNU General Public License as published by
     11 *  the Free Software Foundation; either version 3 of the License, or
     12 *  (at your option) any later version.
     13 *
     14 *  This program is distributed in the hope that it will be useful,
     15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17 *  GNU General Public License for more details.
     18 *
     19 *  You should have received a copy of the GNU General Public License
     20 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
     21 */
    322
    423#ifdef __OS2__
     
    5170{
    5271        /* We call __libc_Back_ioFileSizeSet directly instead of
    53            ftruncate to force it not to zero expanding files to optimize
    54            samba performance when copying files */
     72           ftruncate to force it not to zero expanding files to
     73           optimize Samba performance when copying files */
    5574
    5675        int rc = __libc_Back_ioFileSizeSet(fd, size, 0);
     
    6584int os2_isattribute(char *path, unsigned short attr)
    6685{
    67     HDIR          hdirFindHandle = HDIR_CREATE;
    68     FILEFINDBUF3  FindBuffer     = {0};      /* Returned from FindFirst/Next */
    69     USHORT        dosattr;                      /* attribute to search for */
    70     ULONG         ulResultBufLen = sizeof(FILEFINDBUF3);
    71     ULONG         ulFindCount    = 1;        /* Look for 1 file at a time    */
    72     APIRET        rc             = NO_ERROR; /* Return code                  */
    73     if (attr==aARCH)
     86        HDIR          hdirFindHandle = HDIR_CREATE;
     87        FILEFINDBUF3  FindBuffer     = {0};      /* Returned from FindFirst/Next */
     88        USHORT        dosattr;                   /* attribute to search for */
     89        ULONG         ulResultBufLen = sizeof(FILEFINDBUF3);
     90        ULONG         ulFindCount    = 1;        /* Look for 1 file at a time    */
     91        APIRET        rc             = NO_ERROR; /* Return code                  */
     92        if (attr == aARCH)
    7493                        dosattr=MUST_HAVE_ARCHIVED;
    75     else if (attr==aRONLY)
     94        else if (attr == aRONLY)
    7695                        dosattr=MUST_HAVE_READONLY;
    77     else if (attr==aSYSTEM)
     96        else if (attr == aSYSTEM)
    7897                        dosattr=MUST_HAVE_SYSTEM;
    79     else if (attr==aHIDDEN)
     98        else if (attr == aHIDDEN)
    8099                        dosattr=MUST_HAVE_HIDDEN;
    81100
    82     rc = DosFindFirst( path,                /* File pattern - all files     */
     101        rc = DosFindFirst( path,                 /* File pattern - all files     */
    83102                       &hdirFindHandle,      /* Directory search handle      */
    84                         dosattr,
     103                       dosattr,
    85104                       &FindBuffer,          /* Result buffer                */
    86105                       ulResultBufLen,       /* Result buffer length         */
     
    88107                       FIL_STANDARD);        /* Return Level 1 file info     */
    89108
    90    if (rc != NO_ERROR) {
    91          rc = DosFindClose(hdirFindHandle);    /* Close our directory handle */
    92        return 1;
    93     } else {
    94          rc = DosFindClose(hdirFindHandle);    /* Close our directory handle */
     109        if (rc != NO_ERROR) {
     110                rc = DosFindClose(hdirFindHandle);    /* Close our directory handle */
     111                return 1;
     112        } else {
     113                rc = DosFindClose(hdirFindHandle);    /* Close our directory handle */
    95114        return 0;
    96     } /* endif */
     115        } /* endif */
    97116}
    98117
     
    157176}
    158177*/
     178
    159179// OS/2 specific socketpair() implementation, as it only works in low mem
    160180int os2_socketpair(int fds[2])
    161181{
    162182        int mypair[2];
    163         int rc = 0;
     183        int rc = 0;
    164184
    165185        rc = socketpair(AF_UNIX, SOCK_STREAM, 0, mypair);
    166         if (rc >= 0) {
    167                 fds[0] = mypair[0];
    168                 fds[1] = mypair[1];
    169         }
     186        if (rc >= 0) {
     187                fds[0] = mypair[0];
     188                fds[1] = mypair[1];
     189        }
    170190
    171191        return rc;
     
    178198void os2_randget(char * buffer, int length)
    179199{
    180     UCHAR randbyte();
    181     unsigned int idx;
    182 
    183     for (idx=0; idx<length; idx++)
     200        UCHAR randbyte();
     201        unsigned int idx;
     202
     203        for (idx=0; idx<length; idx++)
    184204        buffer[idx] = randbyte();
    185205
  • trunk/server/source3/lib/recvfile.c

    r464 r656  
    2525
    2626#include "includes.h"
     27#ifdef __OS2__
     28#define pipe(A) os2_socketpair(A)
     29#endif
    2730
    2831/* Do this on our own in TRANSFER_BUF_SIZE chunks.
     
    174177        }
    175178
    176 #ifndef __OS2__
    177179        if ((pipefd[0] == -1) && (pipe(pipefd) == -1)) {
    178 #else
    179         if ((pipefd[0] == -1) && (socketpair(AF_UNIX, SOCK_STREAM,0, pipefd) == -1)) {
    180 #endif
    181180                try_splice_call = false;
    182181                return default_sys_recvfile(fromfd, tofd, offset, count);
  • trunk/server/source3/lib/select.c

    r593 r656  
    2828   This means all Samba signal handlers should call sys_select_signal().
    2929*/
     30#ifdef __OS2__
     31#define pipe(A) os2_socketpair(A)
     32#endif
    3033
    3134static pid_t initialised;
  • trunk/server/source3/libsmb/clientgen.c

    r646 r656  
    435435                DEBUG(0,("Error writing %d bytes to client. (%s)\n",
    436436                         (int)(len+extradata), strerror(errno)));
    437 printf("@remove me, %d bytes written, %d + %d bytes reqested\n", nwritten, len, extradata);
    438437                return false;
    439438        }
  • trunk/server/source3/passdb/pdb_tdb.c

    r414 r656  
    339339        int ret;
    340340
     341    DEBUG(0,("@todo: tdbsam_convert: tdbsam_convert_backup\n"));
    341342        /* We only need the update backup for local db's. */
    342343        if (db_is_local(name) && !tdbsam_convert_backup(name, pp_db)) {
     
    349350        state.success = true;
    350351
     352    DEBUG(0,("@todo: tdbsam_convert: transaction_start\n"));
    351353        if (db->transaction_start(db) != 0) {
    352354                DEBUG(0, ("tdbsam_convert: Could not start transaction\n"));
     
    354356        }
    355357
     358    DEBUG(0,("@todo: tdbsam_convert: tdbsam_upgrade_next_rid\n"));
    356359        if (!tdbsam_upgrade_next_rid(db)) {
    357360                DEBUG(0, ("tdbsam_convert: tdbsam_upgrade_next_rid failed\n"));
     
    359362        }
    360363
     364    DEBUG(0,("@todo: tdbsam_convert: traverse\n"));
    361365        ret = db->traverse(db, tdbsam_convert_one, &state);
    362366        if (ret < 0) {
     
    370374        }
    371375
     376    DEBUG(0,("@todo: tdbsam_convert: dbwrap_store_int32 major\n"));
    372377        if (dbwrap_store_int32(db, TDBSAM_VERSION_STRING,
    373378                               TDBSAM_VERSION) != 0) {
     
    375380                goto cancel;
    376381        }
    377 
     382    DEBUG(0,("@todo: tdbsam_convert: dbwrap_store_int32 minor\n"));
    378383        if (dbwrap_store_int32(db, TDBSAM_MINOR_VERSION_STRING,
    379384                               TDBSAM_MINOR_VERSION) != 0) {
     
    382387        }
    383388
     389    DEBUG(0,("@todo: tdbsam_convert: transaction_commit\n"));
    384390        if (db->transaction_commit(db) != 0) {
    385391                DEBUG(0, ("tdbsam_convert: Could not commit transaction\n"));
     
    390396
    391397 cancel:
     398    DEBUG(0,("@todo: tdbsam_convert: transaction_cancel\n"));
    392399        if (db->transaction_cancel(db) != 0) {
    393400                smb_panic("tdbsam_convert: transaction_cancel failed");
Note: See TracChangeset for help on using the changeset viewer.