Recent changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 01155a985b13bd98f8fc8f3e49f84091dc6e1080:

  Fio 1.51 (2011-03-22 14:33:04 +0100)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (1):
      Fix unsigned integer overflow in IO buffer allocator

 memory.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

---

Diff of recent changes:

diff --git a/memory.c b/memory.c
index 39fb9f2..82a79bd 100644
--- a/memory.c
+++ b/memory.c
@@ -115,7 +115,7 @@ static void free_mem_shm(struct thread_data *td)
 	shmctl(td->shm_id, IPC_RMID, &sbuf);
 }
 
-static int alloc_mem_mmap(struct thread_data *td, unsigned int total_mem)
+static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
 {
 	int flags = MAP_PRIVATE;
 
@@ -155,7 +155,7 @@ static int alloc_mem_mmap(struct thread_data *td, unsigned int total_mem)
 	return 0;
 }
 
-static void free_mem_mmap(struct thread_data *td, unsigned int total_mem)
+static void free_mem_mmap(struct thread_data *td, size_t total_mem)
 {
 	dprint(FD_MEM, "munmap %u %p\n", total_mem, td->orig_buffer);
 	munmap(td->orig_buffer, td->orig_buffer_size);
@@ -166,7 +166,7 @@ static void free_mem_mmap(struct thread_data *td, unsigned int total_mem)
 	}
 }
 
-static int alloc_mem_malloc(struct thread_data *td, unsigned int total_mem)
+static int alloc_mem_malloc(struct thread_data *td, size_t total_mem)
 {
 	td->orig_buffer = malloc(total_mem);
 	dprint(FD_MEM, "malloc %u %p\n", total_mem, td->orig_buffer);
@@ -185,7 +185,7 @@ static void free_mem_malloc(struct thread_data *td)
  */
 int allocate_io_mem(struct thread_data *td)
 {
-	unsigned int total_mem;
+	size_t total_mem;
 	int ret = 0;
 
 	if (td->io_ops->flags & FIO_NOIO)
@@ -200,6 +200,8 @@ int allocate_io_mem(struct thread_data *td)
 			total_mem += td->o.mem_align - page_size;
 	}
 
+	dprint(FD_MEM, "Alloc %lu for buffers\n", (size_t) total_mem);
+
 	if (td->o.mem_type == MEM_MALLOC)
 		ret = alloc_mem_malloc(td, total_mem);
 	else if (td->o.mem_type == MEM_SHM || td->o.mem_type == MEM_SHMHUGE)
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux