mount system call for nullfs

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

mount system call for nullfs

Alfonso Sabato Siciliano
Hello,

I would use "mount" system call

 int mount(const char *type, const char *dir, int flags, void *data);

to mount a nullfs, the problem is about *data;

Where can I find docs? Example? Code?

(the implementation of mount_nullfs(8) uses nmount syscall so it is not
usefulI;

I put a string "/mount_from_dir" then errno = 45, so I think it should be a
struct)

Thanks
Alfonso
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: mount system call for nullfs

Theron Tarigo
On 04/12/18 21:30, Alfonso Sabato Siciliano wrote:
> Hello,
>
> I would use "mount" system call
>
>   int mount(const char *type, const char *dir, int flags, void *data);
>
> to mount a nullfs, the problem is about *data;
>
> Where can I find docs? Example? Code?
Hi Alfonso,

The MOUNT(2) manual says:

      The data argument is a pointer to a structure that contains the type
      specific arguments to mount.  The format for these argument
structures is
      described in the manual page for each file system.  By convention file
      system manual pages are named by prefixing ``mount_'' to the name
of the
      file system as returned by lsvfs(1).  Thus the NFS file system is
      described by the mount_nfs(8) manual page.  It should be noted that a
      manual page for default file systems, known as UFS and UFS2, does not
      exist.

Try looking at /usr/src/sbin/mount_nullfs/ for example.

Cheers,
Theron
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: mount system call for nullfs

Theron Tarigo
Sorry, I notice now this:

On 04/12/18 21:30, Alfonso Sabato Siciliano wrote:

> (the implementation of mount_nullfs(8) uses nmount syscall so it is not
> usefulI;
Why would mount instead of nmount be more useful?

/usr/src/sbin/mount/mount.c notes that

         /* XXX: We need to get away from implementing external mount
          *      programs for every filesystem, and move towards having
          *      each filesystem properly implement the nmount() system
call.
          */

It might be that mount_nullfs only works at the moment with the
nmount-based implementation, in which case you would need to work around
this.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: mount system call for nullfs

Alfonso Sabato Siciliano
In reply to this post by Theron Tarigo

> > I would use "mount" system call
> >
> >   int mount(const char *type, const char *dir, int flags, void *data);
> >
> > to mount a nullfs, the problem is about *data;
> >
> > Where can I find docs? Example? Code?

I solved,
The *data [0] was in FreeBSD4:

struct null_args {
char    *target;    /* Target of loopback  */
};

but was deleted [1], so  I'll use nmount

[0] http://fxr.watson.org/fxr/source/miscfs/nullfs/null.h?v=FREEBSD4
[1] https://svnweb.freebsd.org/base/head/sys/fs/nullfs/null.h?r1=65467&r2=97186

--
alfix86 <[hidden email]>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: mount system call for nullfs

Theron Tarigo
On 04/19/18 11:20, alfix86 wrote:
...
> but was deleted [1], so  I'll use nmount
>
> [0] http://fxr.watson.org/fxr/source/miscfs/nullfs/null.h?v=FREEBSD4
> [1] https://svnweb.freebsd.org/base/head/sys/fs/nullfs/null.h?r1=65467&r2=97186

There is in fact a suggestion that mount() system call be removed entirely:
https://wiki.freebsd.org/IdeasPage#Userspace_mount.28.29_implementation

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"