Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/modules/onefs_cbrl.c

    r414 r745  
    2020
    2121#include "includes.h"
     22#include "smbd/smbd.h"
    2223#include "onefs.h"
    2324
     
    2829#undef DBGC_CLASS
    2930#define DBGC_CLASS DBGC_LOCKING
    30 
    31 extern struct blocking_lock_record *blocking_lock_queue;
    3231
    3332static uint64_t onefs_get_new_id(void) {
     
    8584static void onefs_cbrl_enumerate_blq(const char *fn)
    8685{
     86        struct smbd_server_connection *sconn = smbd_server_conn;
    8787        struct blocking_lock_record *blr;
    8888
     
    9292        DEBUG(10, ("CBRL BLR records (%s):\n", fn));
    9393
    94         for (blr = blocking_lock_queue; blr; blr = blr->next)
    95                 DEBUGADD(10, ("%s\n", onefs_cbrl_blr_state_str(blr)));
     94        if (sconn->using_smb2) {
     95                struct smbd_smb2_request *smb2req;
     96                for (smb2req = sconn->smb2.requests; smb2req; smb2req = nextreq) {
     97                        blr = get_pending_smb2req_blr(smb2req);
     98                        if (blr) {
     99                                DEBUGADD(10, ("%s\n", onefs_cbrl_blr_state_str(blr)));
     100                        }
     101                }
     102        } else {
     103                for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next)
     104                        DEBUGADD(10, ("%s\n", onefs_cbrl_blr_state_str(blr)));
     105        }
    96106}
    97107
    98108static struct blocking_lock_record *onefs_cbrl_find_blr(uint64_t id)
    99109{
     110        struct smbd_server_connection *sconn = smbd_server_conn;
    100111        struct blocking_lock_record *blr;
    101112        struct onefs_cbrl_blr_state *bs;
     
    103114        onefs_cbrl_enumerate_blq("onefs_cbrl_find_blr");
    104115
    105         for (blr = blocking_lock_queue; blr; blr = blr->next) {
    106                 bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
    107 
    108                 /* We don't control all of the BLRs on the BLQ. */
    109                 if (bs == NULL)
    110                         continue;
    111 
    112                 if (bs->id == id) {
    113                         DEBUG(10, ("found %s\n",
    114                             onefs_cbrl_blr_state_str(blr)));
    115                         break;
     116        if (sconn->using_smb2) {
     117                struct smbd_smb2_request *smb2req;
     118                for (smb2req = sconn->smb2.requests; smb2req; smb2req = nextreq) {
     119                        blr = get_pending_smb2req_blr(smb2req);
     120                        if (!blr) {
     121                                continue;
     122                        }
     123                        bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
     124                        if (bs == NULL) {
     125                                continue;
     126                        }
     127                        if (bs->id == id) {
     128                                DEBUG(10, ("found %s\n",
     129                                    onefs_cbrl_blr_state_str(blr)));
     130                                break;
     131                        }
     132                }
     133        } else {
     134                for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next) {
     135                        bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
     136
     137                        /* We don't control all of the BLRs on the BLQ. */
     138                        if (bs == NULL)
     139                                continue;
     140
     141                        if (bs->id == id) {
     142                                DEBUG(10, ("found %s\n",
     143                                    onefs_cbrl_blr_state_str(blr)));
     144                                break;
     145                        }
    116146                }
    117147        }
     
    157187
    158188        /* Process the queue, to try the next lock or finish up. */
    159         process_blocking_lock_queue();
     189        process_blocking_lock_queue(smbd_server_conn);
    160190}
    161191
     
    180210        /* Process the queue. It will end up trying to retake the same lock,
    181211         * see the error in onefs_cbrl_lock_windows() and fail. */
    182         process_blocking_lock_queue();
     212        process_blocking_lock_queue(smbd_server_conn);
    183213}
    184214
Note: See TracChangeset for help on using the changeset viewer.