*
  * In this example we're reading only a single buffer, hence the 1.
  */
-pgaio_io_set_handle_data_32(ioh, (uint32 *) buffer, 1);
+pgaio_io_set_handle_data_32(ioh, (uint32 *) &buffer, 1);
 
 /*
  * Pass the AIO handle to lower-level function. When operating on the level of
  * e.g. due to reaching a limit on the number of unsubmitted IOs, and even
  * complete before smgrstartreadv() returns.
  */
+void *page = BufferGetBlock(buffer);
 smgrstartreadv(ioh, operation->smgr, forknum, blkno,
-               BufferGetBlock(buffer), 1);
+               &page, 1);
 
 /*
  * To benefit from AIO, it is beneficial to perform other work, including
 
 } PgAioHandleCallbackID;
 
 #define PGAIO_HCB_MAX  PGAIO_HCB_LOCAL_BUFFER_READV
-StaticAssertDecl(PGAIO_HCB_MAX <= (1 << PGAIO_RESULT_ID_BITS),
+StaticAssertDecl(PGAIO_HCB_MAX < (1 << PGAIO_RESULT_ID_BITS),
                 "PGAIO_HCB_MAX is too big for PGAIO_RESULT_ID_BITS");