walWrite.c 11.0 KB
Newer Older
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

S
Shengliang Guan 已提交
16
#define _DEFAULT_SOURCE
L
Liu Jicong 已提交
17

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
18
#include "os.h"
S
Shengliang Guan 已提交
19
#include "taoserror.h"
20
#include "tchecksum.h"
S
Shengliang Guan 已提交
21
#include "walInt.h"
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
22

L
Liu Jicong 已提交
23
int32_t walCommit(SWal *pWal, int64_t ver) {
L
Liu Jicong 已提交
24 25
  ASSERT(pWal->vers.commitVer >= pWal->vers.snapshotVer);
  ASSERT(pWal->vers.commitVer <= pWal->vers.lastVer);
L
Liu Jicong 已提交
26
  if (ver < pWal->vers.commitVer || ver > pWal->vers.lastVer) {
L
Liu Jicong 已提交
27
    terrno = TSDB_CODE_WAL_INVALID_VER;
L
Liu Jicong 已提交
28 29
    return -1;
  }
L
Liu Jicong 已提交
30
  pWal->vers.commitVer = ver;
L
Liu Jicong 已提交
31 32 33 34
  return 0;
}

int32_t walRollback(SWal *pWal, int64_t ver) {
L
Liu Jicong 已提交
35
  int  code;
L
Liu Jicong 已提交
36
  char fnameStr[WAL_FILE_LEN];
L
Liu Jicong 已提交
37
  if (ver > pWal->vers.lastVer || ver < pWal->vers.commitVer) {
L
Liu Jicong 已提交
38
    terrno = TSDB_CODE_WAL_INVALID_VER;
L
Liu Jicong 已提交
39 40
    return -1;
  }
wafwerar's avatar
wafwerar 已提交
41
  taosThreadMutexLock(&pWal->mutex);
L
Liu Jicong 已提交
42

L
Liu Jicong 已提交
43 44
  // find correct file
  if (ver < walGetLastFileFirstVer(pWal)) {
L
Liu Jicong 已提交
45 46 47
    // change current files
    code = walChangeWrite(pWal, ver);
    if (code < 0) {
L
Liu Jicong 已提交
48 49 50
      return -1;
    }

L
Liu Jicong 已提交
51
    // delete files
L
Liu Jicong 已提交
52
    int fileSetSize = taosArrayGetSize(pWal->fileInfoSet);
L
Liu Jicong 已提交
53
    for (int i = pWal->writeCur; i < fileSetSize; i++) {
L
Liu Jicong 已提交
54
      walBuildLogName(pWal, ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, i))->firstVer, fnameStr);
55
      taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
56
      walBuildIdxName(pWal, ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, i))->firstVer, fnameStr);
57
      taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
58
    }
L
Liu Jicong 已提交
59
    // pop from fileInfoSet
L
Liu Jicong 已提交
60 61 62 63
    taosArraySetSize(pWal->fileInfoSet, pWal->writeCur + 1);
  }

  walBuildIdxName(pWal, walGetCurFileFirstVer(pWal), fnameStr);
64
  TdFilePtr pIdxTFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ);
L
Liu Jicong 已提交
65

L
Liu Jicong 已提交
66
  // TODO:change to deserialize function
67
  if (pIdxTFile == NULL) {
wafwerar's avatar
wafwerar 已提交
68
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
69 70
    return -1;
  }
L
Liu Jicong 已提交
71
  int64_t idxOff = walGetVerIdxOffset(pWal, ver);
72
  code = taosLSeekFile(pIdxTFile, idxOff, SEEK_SET);
L
Liu Jicong 已提交
73
  if (code < 0) {
wafwerar's avatar
wafwerar 已提交
74
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
75 76
    return -1;
  }
L
Liu Jicong 已提交
77 78
  // read idx file and get log file pos
  // TODO:change to deserialize function
L
Liu Jicong 已提交
79
  SWalIdxEntry entry;
80
  if (taosReadFile(pIdxTFile, &entry, sizeof(SWalIdxEntry)) != sizeof(SWalIdxEntry)) {
wafwerar's avatar
wafwerar 已提交
81
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
82 83 84 85 86
    return -1;
  }
  ASSERT(entry.ver == ver);

  walBuildLogName(pWal, walGetCurFileFirstVer(pWal), fnameStr);
87
  TdFilePtr pLogTFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ);
88
  if (pLogTFile == NULL) {
L
Liu Jicong 已提交
89
    // TODO
wafwerar's avatar
wafwerar 已提交
90
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
91 92
    return -1;
  }
93
  code = taosLSeekFile(pLogTFile, entry.offset, SEEK_SET);
L
Liu Jicong 已提交
94 95
  if (code < 0) {
    // TODO
wafwerar's avatar
wafwerar 已提交
96
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
97 98
    return -1;
  }
L
Liu Jicong 已提交
99
  // validate offset
L
Liu Jicong 已提交
100
  SWalHead head;
101 102
  ASSERT(taosValidFile(pLogTFile));
  int size = taosReadFile(pLogTFile, &head, sizeof(SWalHead));
L
Liu Jicong 已提交
103
  if (size != sizeof(SWalHead)) {
L
Liu Jicong 已提交
104 105 106 107 108
    return -1;
  }
  code = walValidHeadCksum(&head);

  ASSERT(code == 0);
L
Liu Jicong 已提交
109
  if (code != 0) {
L
Liu Jicong 已提交
110 111
    return -1;
  }
L
Liu Jicong 已提交
112 113
  if (head.head.version != ver) {
    // TODO
L
Liu Jicong 已提交
114 115
    return -1;
  }
L
Liu Jicong 已提交
116
  // truncate old files
117
  code = taosFtruncateFile(pLogTFile, entry.offset);
L
Liu Jicong 已提交
118
  if (code < 0) {
L
Liu Jicong 已提交
119 120
    return -1;
  }
121
  code = taosFtruncateFile(pIdxTFile, idxOff);
L
Liu Jicong 已提交
122
  if (code < 0) {
L
Liu Jicong 已提交
123 124
    return -1;
  }
L
Liu Jicong 已提交
125
  pWal->vers.lastVer = ver - 1;
L
Liu Jicong 已提交
126 127
  ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer = ver - 1;
  ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize = entry.offset;
L
Liu Jicong 已提交
128

L
Liu Jicong 已提交
129
  // unlock
wafwerar's avatar
wafwerar 已提交
130
  taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
131 132
  return 0;
}
L
Liu Jicong 已提交
133

L
Liu Jicong 已提交
134
int32_t walBeginSnapshot(SWal *pWal, int64_t ver) {
L
Liu Jicong 已提交
135
  pWal->vers.verInSnapshotting = ver;
L
Liu Jicong 已提交
136 137
  // check file rolling
  if (pWal->cfg.retentionPeriod == 0) {
L
Liu Jicong 已提交
138 139 140 141 142 143
    walRoll(pWal);
  }

  return 0;
}

L
Liu Jicong 已提交
144
int32_t walEndSnapshot(SWal *pWal) {
L
Liu Jicong 已提交
145
  int64_t ver = pWal->vers.verInSnapshotting;
S
Shengliang Guan 已提交
146
  if (ver == -1) return 0;
L
Liu Jicong 已提交
147

L
Liu Jicong 已提交
148
  pWal->vers.snapshotVer = ver;
L
Liu Jicong 已提交
149 150
  int ts = taosGetTimestampSec();

L
Liu Jicong 已提交
151 152 153
  int          deleteCnt = 0;
  int64_t      newTotSize = pWal->totSize;
  SWalFileInfo tmp;
L
Liu Jicong 已提交
154
  tmp.firstVer = ver;
L
Liu Jicong 已提交
155
  // find files safe to delete
L
Liu Jicong 已提交
156
  SWalFileInfo *pInfo = taosArraySearch(pWal->fileInfoSet, &tmp, compareWalFileInfo, TD_LE);
L
Liu Jicong 已提交
157
  if (ver >= pInfo->lastVer) {
L
Liu Jicong 已提交
158 159
    pInfo++;
  }
L
Liu Jicong 已提交
160
  // iterate files, until the searched result
L
Liu Jicong 已提交
161
  for (SWalFileInfo *iter = pWal->fileInfoSet->pData; iter < pInfo; iter++) {
L
fix  
Liu Jicong 已提交
162 163
    if ((pWal->cfg.retentionSize != -1 && pWal->totSize > pWal->cfg.retentionSize) ||
        (pWal->cfg.retentionPeriod != -1 && iter->closeTs + pWal->cfg.retentionPeriod > ts)) {
L
Liu Jicong 已提交
164
      // delete according to file size or close time
L
Liu Jicong 已提交
165 166 167 168 169
      deleteCnt++;
      newTotSize -= iter->fileSize;
    }
  }
  char fnameStr[WAL_FILE_LEN];
L
Liu Jicong 已提交
170 171
  // remove file
  for (int i = 0; i < deleteCnt; i++) {
L
Liu Jicong 已提交
172
    SWalFileInfo *pInfo = taosArrayGet(pWal->fileInfoSet, i);
L
Liu Jicong 已提交
173
    walBuildLogName(pWal, pInfo->firstVer, fnameStr);
174
    taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
175
    walBuildIdxName(pWal, pInfo->firstVer, fnameStr);
176
    taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
177 178
  }

L
Liu Jicong 已提交
179 180 181
  // make new array, remove files
  taosArrayPopFrontBatch(pWal->fileInfoSet, deleteCnt);
  if (taosArrayGetSize(pWal->fileInfoSet) == 0) {
L
Liu Jicong 已提交
182
    pWal->writeCur = -1;
L
Liu Jicong 已提交
183
    pWal->vers.firstVer = -1;
L
Liu Jicong 已提交
184
  } else {
L
Liu Jicong 已提交
185
    pWal->vers.firstVer = ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, 0))->firstVer;
L
Liu Jicong 已提交
186
  }
L
Liu Jicong 已提交
187
  pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1;
L
Liu Jicong 已提交
188
  pWal->totSize = newTotSize;
L
Liu Jicong 已提交
189
  pWal->vers.verInSnapshotting = -1;
L
Liu Jicong 已提交
190

L
Liu Jicong 已提交
191
  // save snapshot ver, commit ver
L
Liu Jicong 已提交
192
  int code = walSaveMeta(pWal);
L
Liu Jicong 已提交
193
  if (code < 0) {
L
Liu Jicong 已提交
194 195 196 197 198 199
    return -1;
  }

  return 0;
}

L
Liu Jicong 已提交
200
int walRoll(SWal *pWal) {
L
Liu Jicong 已提交
201
  int code = 0;
202 203
  if (pWal->pWriteIdxTFile != NULL) {
    code = taosCloseFile(&pWal->pWriteIdxTFile);
L
Liu Jicong 已提交
204
    if (code != 0) {
L
Liu Jicong 已提交
205 206
      return -1;
    }
L
Liu Jicong 已提交
207
  }
208 209
  if (pWal->pWriteLogTFile != NULL) {
    code = taosCloseFile(&pWal->pWriteLogTFile);
L
Liu Jicong 已提交
210
    if (code != 0) {
L
Liu Jicong 已提交
211 212
      return -1;
    }
L
Liu Jicong 已提交
213
  }
214
  TdFilePtr pIdxTFile, pLogTFile;
L
Liu Jicong 已提交
215
  // create new file
L
Liu Jicong 已提交
216
  int64_t newFileFirstVersion = pWal->vers.lastVer + 1;
L
Liu Jicong 已提交
217
  char    fnameStr[WAL_FILE_LEN];
L
Liu Jicong 已提交
218
  walBuildIdxName(pWal, newFileFirstVersion, fnameStr);
219
  pIdxTFile = taosOpenFile(fnameStr, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
220
  if (pIdxTFile == NULL) {
L
Liu Jicong 已提交
221
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
222 223 224
    return -1;
  }
  walBuildLogName(pWal, newFileFirstVersion, fnameStr);
225
  pLogTFile = taosOpenFile(fnameStr, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
226
  if (pLogTFile == NULL) {
L
Liu Jicong 已提交
227
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
228 229 230
    return -1;
  }
  code = walRollFileInfo(pWal);
L
Liu Jicong 已提交
231
  if (code != 0) {
L
Liu Jicong 已提交
232 233
    return -1;
  }
L
Liu Jicong 已提交
234

L
Liu Jicong 已提交
235
  // switch file
236 237
  pWal->pWriteIdxTFile = pIdxTFile;
  pWal->pWriteLogTFile = pLogTFile;
L
Liu Jicong 已提交
238
  pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1;
L
fix  
Liu Jicong 已提交
239
  ASSERT(pWal->writeCur >= 0);
L
Liu Jicong 已提交
240 241 242 243 244

  pWal->lastRollSeq = walGetSeq();
  return 0;
}

L
Liu Jicong 已提交
245
static int walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) {
L
Liu Jicong 已提交
246
  SWalIdxEntry entry = {.ver = ver, .offset = offset};
247
  int          size = taosWriteFile(pWal->pWriteIdxTFile, &entry, sizeof(SWalIdxEntry));
L
Liu Jicong 已提交
248
  if (size != sizeof(SWalIdxEntry)) {
L
Liu Jicong 已提交
249
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
250
    // TODO truncate
L
Liu Jicong 已提交
251
    return -1;
L
Liu Jicong 已提交
252 253 254 255
  }
  return 0;
}

L
Liu Jicong 已提交
256
int64_t walWriteWithSyncInfo(SWal *pWal, int64_t index, tmsg_t msgType, SSyncLogMeta syncMeta, const void *body,
L
Liu Jicong 已提交
257
                             int32_t bodyLen) {
L
Liu Jicong 已提交
258
  if (pWal == NULL) return -1;
L
Liu Jicong 已提交
259
  int code = 0;
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
260

S
TD-1652  
Shengliang Guan 已提交
261
  // no wal
L
Liu Jicong 已提交
262
  if (pWal->cfg.level == TAOS_WAL_NOLOG) return 0;
L
Liu Jicong 已提交
263

L
Liu Jicong 已提交
264
  if (index == pWal->vers.lastVer + 1) {
L
Liu Jicong 已提交
265
    if (taosArrayGetSize(pWal->fileInfoSet) == 0) {
L
Liu Jicong 已提交
266
      pWal->vers.firstVer = index;
L
Liu Jicong 已提交
267 268
      code = walRoll(pWal);
      ASSERT(code == 0);
L
Liu Jicong 已提交
269
    } else {
L
Liu Jicong 已提交
270
      int64_t passed = walGetSeq() - pWal->lastRollSeq;
L
Liu Jicong 已提交
271
      if (pWal->cfg.rollPeriod != -1 && pWal->cfg.rollPeriod != 0 && passed > pWal->cfg.rollPeriod) {
L
Liu Jicong 已提交
272
        walRoll(pWal);
L
Liu Jicong 已提交
273
      } else if (pWal->cfg.segSize != -1 && pWal->cfg.segSize != 0 && walGetLastFileSize(pWal) > pWal->cfg.segSize) {
L
Liu Jicong 已提交
274 275
        walRoll(pWal);
      }
L
Liu Jicong 已提交
276 277
    }
  } else {
L
Liu Jicong 已提交
278 279
    // reject skip log or rewrite log
    // must truncate explicitly first
L
fix  
Liu Jicong 已提交
280
    terrno = TSDB_CODE_WAL_INVALID_VER;
L
Liu Jicong 已提交
281 282
    return -1;
  }
283
  /*if (!tfValid(pWal->pWriteLogTFile)) return -1;*/
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
284

L
Liu Jicong 已提交
285 286
  ASSERT(pWal->writeCur >= 0);

wafwerar's avatar
wafwerar 已提交
287
  taosThreadMutexLock(&pWal->mutex);
L
Liu Jicong 已提交
288

289
  if (pWal->pWriteIdxTFile == NULL || pWal->pWriteLogTFile == NULL) {
L
Liu Jicong 已提交
290
    walSetWrite(pWal);
291 292
    taosLSeekFile(pWal->pWriteLogTFile, 0, SEEK_END);
    taosLSeekFile(pWal->pWriteIdxTFile, 0, SEEK_END);
L
Liu Jicong 已提交
293 294
  }

L
Liu Jicong 已提交
295
  pWal->writeHead.head.version = index;
L
Liu Jicong 已提交
296

L
Liu Jicong 已提交
297
  int64_t offset = walGetCurFileOffset(pWal);
L
Liu Jicong 已提交
298
  pWal->writeHead.head.bodyLen = bodyLen;
L
Liu Jicong 已提交
299
  pWal->writeHead.head.msgType = msgType;
L
Liu Jicong 已提交
300 301

  // sync info
L
Liu Jicong 已提交
302
  pWal->writeHead.head.syncMeta = syncMeta;
L
Liu Jicong 已提交
303

L
Liu Jicong 已提交
304 305
  pWal->writeHead.cksumHead = walCalcHeadCksum(&pWal->writeHead);
  pWal->writeHead.cksumBody = walCalcBodyCksum(body, bodyLen);
306

307
  if (taosWriteFile(pWal->pWriteLogTFile, &pWal->writeHead, sizeof(SWalHead)) != sizeof(SWalHead)) {
L
Liu Jicong 已提交
308
    // ftruncate
L
fix  
Liu Jicong 已提交
309
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
310 311
    wError("vgId:%d, file:%" PRId64 ".log, failed to write since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
           strerror(errno));
L
fix  
Liu Jicong 已提交
312
    return -1;
J
Jeff Tao 已提交
313
  }
S
TD-1846  
Shengliang Guan 已提交
314

315
  if (taosWriteFile(pWal->pWriteLogTFile, (char *)body, bodyLen) != bodyLen) {
L
Liu Jicong 已提交
316
    // ftruncate
L
fix  
Liu Jicong 已提交
317
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
318 319
    wError("vgId:%d, file:%" PRId64 ".log, failed to write since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
           strerror(errno));
L
fix  
Liu Jicong 已提交
320
    return -1;
L
Liu Jicong 已提交
321
  }
L
Liu Jicong 已提交
322

L
Liu Jicong 已提交
323
  code = walWriteIndex(pWal, index, offset);
L
Liu Jicong 已提交
324 325
  if (code != 0) {
    // TODO
L
Liu Jicong 已提交
326
    return -1;
L
Liu Jicong 已提交
327
  }
328

L
Liu Jicong 已提交
329
  // set status
L
Liu Jicong 已提交
330
  pWal->vers.lastVer = index;
L
Liu Jicong 已提交
331
  pWal->totSize += sizeof(SWalHead) + bodyLen;
L
Liu Jicong 已提交
332 333
  walGetCurFileInfo(pWal)->lastVer = index;
  walGetCurFileInfo(pWal)->fileSize += sizeof(SWalHead) + bodyLen;
L
Liu Jicong 已提交
334

wafwerar's avatar
wafwerar 已提交
335
  taosThreadMutexUnlock(&pWal->mutex);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
336

L
fix  
Liu Jicong 已提交
337
  return 0;
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
338 339
}

L
Liu Jicong 已提交
340
int64_t walWrite(SWal *pWal, int64_t index, tmsg_t msgType, const void *body, int32_t bodyLen) {
L
Liu Jicong 已提交
341
  SSyncLogMeta syncMeta = {
L
Liu Jicong 已提交
342 343 344 345
      .isWeek = -1,
      .seqNum = UINT64_MAX,
      .term = UINT64_MAX,
  };
L
Liu Jicong 已提交
346
  return walWriteWithSyncInfo(pWal, index, msgType, syncMeta, body, bodyLen);
L
Liu Jicong 已提交
347 348
}

L
Liu Jicong 已提交
349
void walFsync(SWal *pWal, bool forceFsync) {
L
Liu Jicong 已提交
350
  if (forceFsync || (pWal->cfg.level == TAOS_WAL_FSYNC && pWal->cfg.fsyncPeriod == 0)) {
L
Liu Jicong 已提交
351
    wTrace("vgId:%d, fileId:%" PRId64 ".log, do fsync", pWal->cfg.vgId, walGetCurFileFirstVer(pWal));
352
    if (taosFsyncFile(pWal->pWriteLogTFile) < 0) {
L
Liu Jicong 已提交
353 354
      wError("vgId:%d, file:%" PRId64 ".log, fsync failed since %s", pWal->cfg.vgId, walGetCurFileFirstVer(pWal),
             strerror(errno));
355 356
    }
  }
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
357 358
}

L
Liu Jicong 已提交
359
/*static int walValidateOffset(SWal* pWal, int64_t ver) {*/
L
Liu Jicong 已提交
360 361 362 363 364 365 366
/*int code = 0;*/
/*SWalHead *pHead = NULL;*/
/*code = (int)walRead(pWal, &pHead, ver);*/
/*if(pHead->head.version != ver) {*/
/*return -1;*/
/*}*/
/*return 0;*/
L
Liu Jicong 已提交
367
/*}*/
L
Liu Jicong 已提交
368

L
Liu Jicong 已提交
369
/*static int64_t walGetOffset(SWal* pWal, int64_t ver) {*/
L
Liu Jicong 已提交
370 371 372 373
/*int code = walSeekVer(pWal, ver);*/
/*if(code != 0) {*/
/*return -1;*/
/*}*/
L
Liu Jicong 已提交
374

L
Liu Jicong 已提交
375 376 377 378
/*code = walValidateOffset(pWal, ver);*/
/*if(code != 0) {*/
/*return -1;*/
/*}*/
L
Liu Jicong 已提交
379

L
Liu Jicong 已提交
380
/*return 0;*/
L
Liu Jicong 已提交
381
/*}*/