通过 C 中的 NFS v4 进行文件锁定租用

发布于 2024-08-13 07:24:40 字数 297 浏览 3 评论 0原文

有人知道如何使用 NFS v4 的奇特文件锁定功能吗? (例如关于 NFS 协议(向下滚动)中进行了描述)。据说 NFS v4 支持文件锁租赁,生命周期为 45 秒。我愿意相信 Linux 内核(我使用的是 gentoo 2.6.30)很高兴地处理这些细节,并且我可以使用 fcntl() 并且这一切都会水到渠成。然而,我猜测我必须以某种方式做一些特殊的事情来获取、维护和释放锁租约。感谢所有帮助。

does anybody know how to use the fancy file locking features of NFS v4? (described in e.g. About the NFS protocol (scroll down)). supposedly NFS v4 supports file lock leasing with a 45 second lifetime. I would like to believe that the linux kernel (I'm using gentoo 2.6.30) happily takes care of these details, and I can use fcntl() and it all comes out in the wash. I am guessing, however, that I have to do something special somehow to get, maintain, and release the lock lease. all help appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-08-20 07:24:40

你说得对,fcntl 会为你处理所有这些事务。租约管理由nfs客户端(linux中的内核模块)完成

you are right, fcntl takes care of all this business for you. The lease management is done by the nfs client(kernel module in linux)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文