Hello,
After first posting to the wrong mailing list I'm hopefully on the right now...
I'm trying to implement an ioctl call for a FUSE filesystem.
After searching around I found this blogpost: http://fuse4x.1054701.n5.nabble.com/Fuse4X-0-8-7-has-been-released-td4610274.html
It say's that one of the next releases will feature ioctl in fuse4x - but I didn't find any further information.
Can someone maybe give me an update on this?
Is there already some code or is someone working on it?
Is help needed?
On Wed, Mar 14, 2012 at 5:57 AM, Florian Bogner <fbo...@gmail.com> wrote:
> Hello,
>
> After first posting to the wrong mailing list I'm hopefully on the right
> now...
>
> I'm trying to implement an ioctl call for a FUSE filesystem.
> After searching around I found this
> blogpost: http://fuse4x.1054701.n5.nabble.com/Fuse4X-0-8-7-has-been-released-td4610274.html
> It say's that one of the next releases will feature ioctl in fuse4x - but I
> didn't find any further information.
I expected to implement it soon after 0.8.7 but never had time for it. Sorry.
> Can someone maybe give me an update on this?
FUSE_IOCTL is not implemented as well as other bits (e.g. FUSE_POLL)
but it is definitely on my plate and I would like to implement it. The
userspace part is ready so the only thing have to be done is kernel
part.
> Is there already some code or is someone working on it?
IOCTL sits half-baked in my local repo - I'll try to look at it once again.
> Is help needed?
The project is constantly looking for a new contributors/developers so
yes, any help is welcome. Especially if you have experience with
- XNU/BSD virtual filesystem layer
- Packermaker tool
- Objective C
On Wed, Mar 14, 2012 at 3:07 PM, Florian Bogner <fbo...@gmail.com> wrote:
> Hi Anatol,
>
> Yes we were really happy when we discovered the user space part - fuse4x is
> currently the only one having the headers.
>
> Yes I'm definitely interest in getting involved - the problem is that I'm
> currently quite stressed (full time job + university)
Yep, I feel your pain :)
> I did quite some low level development (mainly on embedded systems) so the
> kernel module (VFS) is the most interesting part for me.
>
> Are you interested in implementing the IOCTL part or would you like to
> source it out? ;-)
If you can take care of IOCTL in kernel this would be really great. I
expect that this function will be ~50-60 lines of code.
On Wed, Mar 14, 2012 at 3:22 PM, Florian Bogner <fbo...@gmail.com> wrote:
> Hi
>
> Jep that sounds like a plan!
>
> Could you just send me a patch from the things you already did - then I
> would take a look and create a small timeframe...
Sure. I rebased my changes and pushed it here
https://github.com/anatol/kext/tree/ioctl
On Wed, Mar 14, 2012 at 4:14 PM, Anatol Pomozov
<anatol....@gmail.com> wrote:
> Hi
>
> On Wed, Mar 14, 2012 at 3:22 PM, Florian Bogner <fbo...@gmail.com> wrote:
>> Hi
>>
>> Jep that sounds like a plan!
>>
>> Could you just send me a patch from the things you already did - then I
>> would take a look and create a small timeframe...
>
> Sure. I rebased my changes and pushed it here
> https://github.com/anatol/kext/tree/ioctl
I stuck with the fact that ioctl() returns ENOTTY. It might be related
to this function
https://github.com/anatol/xnu/blob/master/bsd/vfs/vfs_vnops.c#L1259
It looks like XNU does not allow custom ioctl for regular files (only
for device files???). I did not find any solution how to make ioctl
call to fuse VNOP function.
[ENOTTY] fildes is not associated with a character special device. [ENOTTY] The specified request does not apply to the kind of object that the descriptor fildes references.
On Thu, Mar 15, 2012 at 1:36 AM, Florian Bogner <fbo...@gmail.com> wrote:
> Hello,
>
> After readying the ioctl man page I totally agree with you!
>
> http://www.manpagez.com/man/2/ioctl/
>
> [ENOTTY] fildes is not associated with a character special
> device.
>
> [ENOTTY] The specified request does not apply to the kind of
> object that the descriptor fildes references.
> ioctl should only be called on special devices!
I do not see such restriction with fuse on Linux. It allows to call
ioctl() on regular files as well. It seems up to filesystem
implementation to return this error.
In macosx the kernel checks if file is a special devices. If it is not
then kernel returns ENOTTY and vfs layer is not called at all.
Anyway the ioctl() is implemented, please check
https://github.com/anatol/kext and test if you have time. You might
look at fuse/examples/fioc.c example that shows how ioctl can be used.
Currently ioctl retry logic is not implemented yet (ioctl in cuse).