The invention discloses a method, a product and equipment for sharing a
file system by multiple hosts and a storage medium, and relates to the technical field of computers, which comprises the following steps: configuring a
shared memory device as a character device, directly mapping to a user mode
virtual address space, bypassing a kernel
page cache, and directly reading and writing a
physical address of the
shared memory. A
shared memory is divided into a super block area, a
metadata area, a log area and a data area during formatting, all hosts perform unified operation through the shared
metadata area, stand-alone cache interference is avoided, a hidden
metadata file is created to map a non-data area during mounting, a log item is scanned to reconstruct a
directory file structure, and the mounting efficiency is improved. All hosts generate a
directory file structure completely consistent with the shared memory through log replay, the problem of
data consistency caused by a cache strategy in a traditional multi-host
file system is solved, and the effects that multiple hosts share a unified memory view, operation is real-time and synchronous, and
data access delay is reduced are achieved.