Commit bacf546e authored by unknown's avatar unknown

os0file.c Replace some / 256 by >> operations


innobase/os/os0file.c:
  Replace some / 256 by >> operations
parent fb531dae
...@@ -459,7 +459,7 @@ os_file_get_size( ...@@ -459,7 +459,7 @@ os_file_get_size(
if (sizeof(off_t) > 4) { if (sizeof(off_t) > 4) {
*size = (ulint)(offs & 0xFFFFFFFF); *size = (ulint)(offs & 0xFFFFFFFF);
*size_high = (ulint)((offs / (256 * 256)) / (256 * 256)); *size_high = (ulint)(offs >> 32);
} else { } else {
*size = (ulint) offs; *size = (ulint) offs;
*size_high = 0; *size_high = 0;
...@@ -491,7 +491,7 @@ os_file_set_size( ...@@ -491,7 +491,7 @@ os_file_set_size(
byte* buf; byte* buf;
ulint i; ulint i;
ut_a(((((size / 256) / 256) / 256) / 256) == 0); ut_a(size == (size & 0xFFFFFFFF));
try_again: try_again:
/* We use a very big 8 MB buffer in writing because Linux may be /* We use a very big 8 MB buffer in writing because Linux may be
...@@ -505,8 +505,8 @@ try_again: ...@@ -505,8 +505,8 @@ try_again:
} }
offset = 0; offset = 0;
low = (ib_longlong)size + (((ib_longlong)size_high) low = (ib_longlong)size + (((ib_longlong)size_high) << 32);
* 256) * 256 * 256 * 256;
while (offset < low) { while (offset < low) {
if (low - offset < UNIV_PAGE_SIZE * 512) { if (low - offset < UNIV_PAGE_SIZE * 512) {
n_bytes = (ulint)(low - offset); n_bytes = (ulint)(low - offset);
...@@ -516,7 +516,7 @@ try_again: ...@@ -516,7 +516,7 @@ try_again:
ret = os_file_write(name, file, buf, ret = os_file_write(name, file, buf,
(ulint)(offset & 0xFFFFFFFF), (ulint)(offset & 0xFFFFFFFF),
(ulint)((((offset / 256) / 256) / 256) / 256), (ulint)(offset >> 32),
n_bytes); n_bytes);
if (!ret) { if (!ret) {
ut_free(buf); ut_free(buf);
...@@ -609,14 +609,14 @@ os_file_pread( ...@@ -609,14 +609,14 @@ os_file_pread(
{ {
off_t offs; off_t offs;
ut_a(((((offset / 256) / 256) / 256) / 256) == 0); ut_a((offset & 0xFFFFFFFF) == offset);
/* If off_t is > 4 bytes in size, then we assume we can pass a /* If off_t is > 4 bytes in size, then we assume we can pass a
64-bit address */ 64-bit address */
if (sizeof(off_t) > 4) { if (sizeof(off_t) > 4) {
offs = (off_t)offset + ((((off_t)offset_high) offs = (off_t)offset + (((off_t)offset_high) << 32);
* 256) * 256 * 256 * 256);
} else { } else {
offs = (off_t)offset; offs = (off_t)offset;
...@@ -675,14 +675,14 @@ os_file_pwrite( ...@@ -675,14 +675,14 @@ os_file_pwrite(
ssize_t ret; ssize_t ret;
off_t offs; off_t offs;
ut_a(((((offset / 256) / 256) / 256) / 256) == 0); ut_a((offset & 0xFFFFFFFF) == offset);
/* If off_t is > 4 bytes in size, then we assume we can pass a /* If off_t is > 4 bytes in size, then we assume we can pass a
64-bit address */ 64-bit address */
if (sizeof(off_t) > 4) { if (sizeof(off_t) > 4) {
offs = (off_t)offset + ((((off_t)offset_high) offs = (off_t)offset + (((off_t)offset_high) << 32);
* 256) * 256 * 256 * 256);
} else { } else {
offs = (off_t)offset; offs = (off_t)offset;
...@@ -772,7 +772,7 @@ os_file_read( ...@@ -772,7 +772,7 @@ os_file_read(
ibool retry; ibool retry;
ulint i; ulint i;
ut_a(((((offset / 256) / 256) / 256) / 256) == 0); ut_a((offset & 0xFFFFFFFF) == offset);
os_n_file_reads++; os_n_file_reads++;
...@@ -856,7 +856,7 @@ os_file_write( ...@@ -856,7 +856,7 @@ os_file_write(
ibool retry; ibool retry;
ulint i; ulint i;
ut_a(((((offset / 256) / 256) / 256) / 256) == 0); ut_a((offset & 0xFFFFFFFF) == offset);
os_n_file_writes++; os_n_file_writes++;
try_again: try_again:
...@@ -1466,7 +1466,6 @@ os_aio( ...@@ -1466,7 +1466,6 @@ os_aio(
ibool retry; ibool retry;
ulint wake_later; ulint wake_later;
ut_a(((((offset / 256) / 256) / 256) / 256) == 0);
ut_ad(file); ut_ad(file);
ut_ad(buf); ut_ad(buf);
ut_ad(n > 0); ut_ad(n > 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment