List:Commits« Previous MessageNext Message »
From:jonas Date:January 24 2006 10:42am
Subject:bk commit into 5.1 tree (jonas:1.2073) BUG#16742
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2073 06/01/24 11:41:58 jonas@stripped +1 -0
  bug#16742 - ndb dd - round filesize upwards

  storage/ndb/src/kernel/blocks/tsman.cpp
    1.3 06/01/24 11:41:55 jonas@stripped +6 -11
    Round filesize upwards

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/mysql-5.1-new

--- 1.2/storage/ndb/src/kernel/blocks/tsman.cpp	2006-01-11 09:26:03 +01:00
+++ 1.3/storage/ndb/src/kernel/blocks/tsman.cpp	2006-01-24 11:41:55 +01:00
@@ -684,20 +684,15 @@
   req->file_size_lo = lo;
 
   Uint64 pages = (Uint64(hi) << 32 | lo) / File_formats::NDB_PAGE_SIZE;
-  
-  // Extent size in #pages
-  Uint32 extent_size = ts_ptr.p->m_extent_size;
+  Uint32 extent_size = ts_ptr.p->m_extent_size; // Extent size in #pages
+  Uint64 extents = (pages + extent_size - 1) / extent_size;
+  extents = extents ? extents : 1;
+  Uint64 data_pages = extents * extent_size;
+
   Uint32 eh_words = File_formats::Datafile::extent_header_words(extent_size);
   ndbrequire(eh_words < File_formats::Datafile::EXTENT_PAGE_WORDS);
-  
   Uint32 extents_per_page = File_formats::Datafile::EXTENT_PAGE_WORDS/eh_words;
-  Uint64 tmp = Uint64(extents_per_page) * Uint64(extent_size);
-  Uint64 extent_pages = pages / (1+tmp);
-  extent_pages = extent_pages ? extent_pages : 1;
-  
-  Uint64 data_pages = pages - extent_pages -1;
-  Uint64 extents = data_pages / extent_size;
-  data_pages = extents * extent_size;
+  Uint64 extent_pages = (extents + extents_per_page - 1) / extents_per_page;
   
   ptr.p->m_create.m_extent_pages = extent_pages;
   ptr.p->m_create.m_data_pages = data_pages;
Thread
bk commit into 5.1 tree (jonas:1.2073) BUG#16742jonas24 Jan