A file system DLMPFS has been proposed for the Linux kernel.

Alexander Aring from Red Hat, who supports the IEEE 802.15.4, DLM, and flock/fcntl subsystems in the Linux kernel, introduced a specialized filesystem DLMPFS in the kernel developers' mailing list. The proposed FS provides a layer for distributed file locking, implemented based on DLM (Distributed Lock Manager) and ramfs. The DLMPFS implementation is available as a set of patches for Linux kernel 6.19.

DLMPFS allows working with a shared file hierarchy across multiple hosts, creating and deleting files and directories, and setting or removing locks on files using the standard flock() and fcntl() functions. However, DLMPFS does not allow reading and writing data to files, being limited to locking operations only. A further limitation is that the locking state can only be determined by knowing the full file path to the locked file (DLM requires the resource name to identify the lock).

With DLMPFS, existing applications that rely on setting locks through the flock/fcntl API can be easily adapted to use distributed locks spanning multiple hosts in a cluster, without needing specialized distributed FS for data storage.

DLMPFS differs from the already existing similar filesystem DLMFS by using the flock/fcntl API instead of the FS-specific API of OCFS2. Future plans for DLMPFS include adding distributed locks marked in the POSIX specification and integrating various backends to connect not only with DLM but also with other distributed lock managers like NFS lockd.

Example usage (on the second node, the lock on the file /mnt/lock will be released after 20 seconds): Node 1: mount -t dlmpfs -o clname=$CLUSTERNAME none /mnt touch /mnt/lock flock /mnt/lock -c 'echo "acquired"; sleep 20; echo "released"' Node 2: mount -t dlmpfs -o clname=$CLUSTERNAME none /mnt touch /mnt/lock flock /mnt/lock -c 'echo "acquired"; sleep 20; echo "released"'

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster