public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: jonathan@jonmasters.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: how do you call userspace syscalls (e.g. sys_rename) from inside kernel
Date: Tue, 12 Oct 2004 14:16:22 +0100	[thread overview]
Message-ID: <20041012131622.GX22010@lkcl.net> (raw)
In-Reply-To: <35fb2e5904101117156b033f6b@mail.gmail.com>

hiya jon,

i'm placing _a_ version at http://hands.com/~lkcl/fuse.xattr.2.tgz.

it's the "mostly userspace" version, with hacked-up xattrs that "track"
what the userspace code does, inside the kernel.

due to having to implement fuse "getxattr" and friends in
kernel-space (in order to avoid having the -512 error message
returned to selinux/hooks.c), there are two locations in the
code where you must specify the proxy point:

1) example/fusexmp.c you must change "/home/sez" to your-directory.

2) kernel/util.c likewise.

in 1) it is the location where userspace file access occurs.  2) is
obviously matching the userspace xattr access.

i _do_ have a version of fuse where
pretty-much-everything-but-the-inode-allocation-which-is-done-in-libfuse-has-been-moved-to-kernel.

i've been examining a number of kernel modules (ncpfs primarily)
in an attempt to understand how to move libfuse's userspace
inode allocation system into kernelspace.

i'm tempted to abandon fuse and use lufs instead... that has a directory
cache in userspace but at least it appears to allocate inodes in
kernel (using iunique()).

hmmm...


On Tue, Oct 12, 2004 at 01:15:34AM +0100, Jon Masters wrote:
> On Fri, 8 Oct 2004 14:04:42 +0100, Luke Kenneth Casson Leighton
> <lkcl@lkcl.net> wrote:
> > could someone kindly advise me on the location of some example code in
> > the kernel which calls one of the userspace system calls from inside the
> > kernel?
> 
> Hi Luke,
> 
> I enjoyed your recent talk at OxLUG in which you mentioned this
> briefly. Could you please send me the source that you are working on
> so that I can take a look and make suggestions if tha'ts useful - I
> posted to the OxLUG list but you're not actually on it and although I
> now have your address from someone, this post reminded me.
> 
> I've copied lkml for two reasons - a). Someone else might want to take
> a look. b). I sat and talked with Luke for a while about this, he's
> not a typical "I want to do stuff in the kernel I should be doing from
> userspace" kind of person in my opinion (there might still be a better
> way but until I see more what he's actually doing then I can't work
> out what).
> 
> Jon.

-- 
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love.  If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:lkcl@lkcl.net"> lkcl@lkcl.net </a> <br />


  reply	other threads:[~2004-10-12 13:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 13:04 how do you call userspace syscalls (e.g. sys_rename) from inside kernel Luke Kenneth Casson Leighton
2004-10-08 13:07 ` Fabiano Ramos
2004-10-08 13:38   ` Brice Goglin
2004-10-08 15:04     ` Fabiano Ramos
2004-10-08 15:35   ` Luke Kenneth Casson Leighton
2004-10-08 14:02 ` Brian Gerst
2004-10-08 15:18   ` Luke Kenneth Casson Leighton
2004-10-08 15:12     ` Bernd Petrovitsch
2004-10-08 17:03       ` Luke Kenneth Casson Leighton
2004-10-08 15:18     ` Brice Goglin
2004-10-08 16:20       ` Luke Kenneth Casson Leighton
2004-10-08 16:37         ` Jan-Benedict Glaw
2004-10-08 17:37           ` Luke Kenneth Casson Leighton
2004-10-08 15:27     ` Brian Gerst
2004-10-08 17:04       ` Luke Kenneth Casson Leighton
2004-10-12  0:15 ` Jon Masters
2004-10-12 13:16   ` Luke Kenneth Casson Leighton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-10 23:13 Aboo Valappil
2004-10-10 23:35 ` Arnd Bergmann
2004-10-11  9:56 ` Jirka Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041012131622.GX22010@lkcl.net \
    --to=lkcl@lkcl.net \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox