~drizzle-developers/ubuntu/karmic/drizzle/ppa

« back to all changes in this revision

Viewing changes to plugin/innobase/trx/trx0rseg.c

  • Committer: Monty Taylor
  • Date: 2010-11-24 18:44:57 UTC
  • mfrom: (1308.1.31 trunk)
  • Revision ID: mordred@inaugust.com-20101124184457-qd6jvoe2wgnvl3yq
Tags: 2010.11.04-0ubuntu1~karmic1
* New upstream release.
* Turn off -Werror for packaging builds. (Closes: #602662)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
286
286
                }
287
287
        }
288
288
}
289
 
 
290
 
/****************************************************************//**
291
 
Creates a new rollback segment to the database.
292
 
@return the created segment object, NULL if fail */
293
 
UNIV_INTERN
294
 
trx_rseg_t*
295
 
trx_rseg_create(
296
 
/*============*/
297
 
        ulint   space,          /*!< in: space id */
298
 
        ulint   max_size,       /*!< in: max size in pages */
299
 
        ulint*  id,             /*!< out: rseg id */
300
 
        mtr_t*  mtr)            /*!< in: mtr */
301
 
{
302
 
        ulint           flags;
303
 
        ulint           zip_size;
304
 
        ulint           page_no;
305
 
        trx_rseg_t*     rseg;
306
 
 
307
 
        mtr_x_lock(fil_space_get_latch(space, &flags), mtr);
308
 
        zip_size = dict_table_flags_to_zip_size(flags);
309
 
        mutex_enter(&kernel_mutex);
310
 
 
311
 
        page_no = trx_rseg_header_create(space, zip_size, max_size, id, mtr);
312
 
 
313
 
        if (page_no == FIL_NULL) {
314
 
 
315
 
                mutex_exit(&kernel_mutex);
316
 
                return(NULL);
317
 
        }
318
 
 
319
 
        rseg = trx_rseg_mem_create(*id, space, zip_size, page_no, mtr);
320
 
 
321
 
        mutex_exit(&kernel_mutex);
322
 
 
323
 
        return(rseg);
324
 
}