Thank you for replying, I see your good suggestion by using lseek, but I still don’t know how to use it to calculate these LBAs in OpenSolarisX system file.
The following function that I am trying to port to OpenSolarisX ZFS is finding a range of start and end physical unit LBAs by given file and its offset bytes. I call send you this function codes, it is about more one paper page long. void TWL_File_LBA::get_unit_lba_range(char *file_name, ULONGLONG byte_offset, ULONGLONG record_length, ULONGLONG &range_start_unit_lba, ULONGLONG &range_end_unit_lba, ULONGLONG &run_length) In the code (linux), it mainly used if (-1 == ioctl(fileFD, FIGETBSZ, &FsBlockSize)) if (-1 == ioctl(fileFD, FIBMAP, &FsBlockAtOffset)) to find out the FsBlockAtOffset, then used it to calculate begin and end unit LBAs. Thank you very much for your time. Thai. -- This message posted from opensolaris.org _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code