Why are there no file insertion syscalls

On recent Linux systems that is actually possible, but with block (4096 most of the time), not byte granularity, and only on some filesystems (ext4 and xfs).

Quoting from the fallocate(2) manpage:

int fallocate(int fd, int mode, off_t offset, off_t len);

[...]

Collapsing file space

Specifying the FALLOC_FL_COLLAPSE_RANGE flag (available since Linux 3.15) in mode removes a byte range from a file, without leaving a hole. The byte range to be collapsed starts at offset and continues for len bytes. At the completion of the operation, the contents of the file starting at the location offset+len will be appended at the location offset, and the file will be len bytes smaller.

[...]

Increasing file space

Specifying the FALLOC_FL_INSERT_RANGE flag (available since Linux 4.1) in mode increases the file space by inserting a hole within the file size without overwriting any existing data. The hole will start at offset and continue for len bytes. When inserting the hole inside file, the contents of the file starting at offset will be shifted upward (i.e., to a higher file offset) by len bytes. Inserting a hole inside a file increases the file size by len bytes.


As all current file systems do not require the file to be stored in a continuous memory block,

Filesystems might not require files to be stored in a continuous area (and that would be very inflexible indeed), but usually files are stored in fixed-size blocks (or sequences of contiguous blocks). Doing it that way simplifies the implementation, and the blocks are usually multiples of the block size of the underlying device.

So, implementing inserts of blocks with arbitrary length would make the file system format and implementation rather more complex or require moving potentially large amounts of data around. Neither of those is really good, and complex data structures can be built in userspace on top of the filesystem API.