libtrivfs/ChangeLog 2015-12-17 Svante Signell * Makefile (FSSRCS): Add file-lock-stat.c * trivfs.h (trivfs_peropen): Fix a typo. * Split out file-lock-stat.c (trivfs_S_file_lock_stat) from file-lock.c to a separate file. * file-lock.c (trivfs_S_file_lock): Implement locking using the new record locking functions. proxy solution. * file-lock-stat.c (trivfs_S_file_lock_stat): Likewise * file-record-lock.c (trivfs_S_file_record_lock): Likewise 2001-04-11 Neal H Walfield * file-record-lock.c: New file. Implement trivfs_S_file_record_lock. * Makefile (FSSRCS): Add file-record-lock.c Index: hurd-0.7.git20160114/libtrivfs/Makefile =================================================================== --- hurd-0.7.git20160114.orig/libtrivfs/Makefile +++ hurd-0.7.git20160114/libtrivfs/Makefile @@ -12,8 +12,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# along with the GNU Hurd. If not, see . dir := libtrivfs makemode := library @@ -22,7 +21,8 @@ FSSRCS= dir-link.c dir-mkdir.c dir-mkfil dir-rename.c dir-rmdir.c dir-unlink.c file-chauthor.c \ file-chflags.c file-chmod.c file-chown.c file-get-trans.c \ file-get-transcntl.c file-getcontrol.c file-getfh.c \ - file-getlinknode.c file-lock.c file-set-trans.c file-statfs.c \ + file-getlinknode.c file-lock.c file-lock-stat.c file-record-lock.c \ + file-set-trans.c file-statfs.c \ file-sync.c file-syncfs.c file-set-size.c file-utimes.c file-exec.c \ file-access.c dir-chg.c file-chg.c file-get-storage-info.c \ file-get-fs-options.c file-reparent.c get-source.c Index: hurd-0.7.git20160114/libtrivfs/trivfs.h =================================================================== --- hurd-0.7.git20160114.orig/libtrivfs/trivfs.h +++ hurd-0.7.git20160114/libtrivfs/trivfs.h @@ -169,7 +169,7 @@ trivfs_create_control (mach_port_t under void trivfs_clean_protid (void *); void trivfs_clean_cntl (void *); -/* This demultiplees messages for trivfs ports. */ +/* This demultiplexes messages for trivfs ports. */ int trivfs_demuxer (mach_msg_header_t *, mach_msg_header_t *); /* Return a new protid pointing to a new peropen in CRED, with REALNODE as Index: hurd-0.7.git20160114/libtrivfs/file-lock.c =================================================================== --- hurd-0.7.git20160114.orig/libtrivfs/file-lock.c +++ hurd-0.7.git20160114/libtrivfs/file-lock.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994,2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2015, 2016 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -12,8 +12,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + along with the GNU Hurd. If not, see . */ #include "priv.h" #include "trivfs_fs_S.h" @@ -23,13 +22,5 @@ trivfs_S_file_lock (struct trivfs_protid mach_port_t reply, mach_msg_type_name_t reply_type, int flags) { - return EOPNOTSUPP; -} - -kern_return_t -trivfs_S_file_lock_stat (struct trivfs_protid *cred, - mach_port_t reply, mach_msg_type_name_t reply_type, - int *mystatus, int *otherstat) -{ - return EOPNOTSUPP; + return cred ? file_lock (cred->realnode, flags) : EOPNOTSUPP; } Index: hurd-0.7.git20160114/libtrivfs/file-lock-stat.c =================================================================== --- /dev/null +++ hurd-0.7.git20160114/libtrivfs/file-lock-stat.c @@ -0,0 +1,26 @@ +/* + Copyright (C) 1994, 2002, 2015, 2016 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd. If not, see . */ + +#include "priv.h" +#include "trivfs_fs_S.h" + +kern_return_t +trivfs_S_file_lock_stat (struct trivfs_protid *cred, + mach_port_t reply, mach_msg_type_name_t reply_type, + int *mystatus, int *otherstatus) +{ + return cred ? file_lock_stat (cred->realnode, mystatus, otherstatus) : EOPNOTSUPP; +} Index: hurd-0.7.git20160114/libtrivfs/file-record-lock.c =================================================================== --- /dev/null +++ hurd-0.7.git20160114/libtrivfs/file-record-lock.c @@ -0,0 +1,30 @@ +/*Copyright (C) 2001, 2014-2016 Free Software Foundation + + Written by Neal H Walfield + + This file is part of the GNU Hurd. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd. If not, see . */ + +#include "priv.h" +#include "trivfs_fs_S.h" + +kern_return_t +trivfs_S_file_record_lock (struct trivfs_protid *cred, + mach_port_t reply, + mach_msg_type_name_t reply_type, + int cmd, struct flock64 *lock) +{ + return cred ? file_record_lock (cred->realnode, cmd, lock) : EOPNOTSUPP; +}