简体   繁体   English

我正在写一个保险丝文件系统。 如何将额外的数据传递给fuse_operations?

[英]I'm writing a fuse filesystem. How do I pass extra data to fuse_operations?

I'm writing a fuse filesystem. 我正在写一个保险丝文件系统。

How do I pass extra data to the functions in struct fuse_operations ? 如何将多余的数据传递给struct fuse_operations的函数?

In particular, how can I access the void * , that I can set in fuse_main() and similar, from functions in struct fuse_operations ? 特别是,如何从struct fuse_operations函数访问可以在fuse_main()设置的void *

I'm looking for a method other than global variables, as I am making my fuse operations testable. 我正在寻找除全局变量以外的方法,因为我正在测试保险丝操作。

http://fuse.sourceforge.net/doxygen/structfuse__context.html http://fuse.sourceforge.net/doxygen/structfuse__context.html

I can get the data with fuse_get_context . 我可以使用fuse_get_context获取数据。 I should be able to fake this function in my tests. 我应该可以在测试中伪造此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM