Actually, the 'noautoextattr' option does work in 10.5. In particular,
if I don't "short circuit" com.apple.FinderInfo and
com.apple.ResourceFork in the kernel, and the user-space file system
handles these correctly, then it can use these to implement per-file
custom icons. The 32-byte finder info data would need to have the "has
custom icon" bit set and the resource fork data would need to be the
icon file.

I haven't test, or even implemented this for 10.4 yet--my suspicion is
that Finder won't be happy still, but feel free to test and verify one
way or another.

Amit

On Aug 15, 12:53 pm, Amit Singh <[EMAIL PROTECTED]> wrote:
> The user-space library does argument filtering, so you have to add new
> arguments to lib/mount_bsd.c in there too. Yes, it's a tad painful. I
> think I already added 'noautoextattr' to the 10.5 MacFUSE tree.
>
> Amit
>
> On Aug 15, 11:33 am, "Hamish Allan" <[EMAIL PROTECTED]> wrote:
>
> > On 8/11/07, Amit Singh <[EMAIL PROTECTED]> wrote:
>
> > > The next release of MacFUSE (at least for Leopard, and perhaps for
> > > Tiger as well) will let you alter the behavior of
> > > fuse_is_shortcircuit_xattr() through a mount-time argument. So,
> > > something like "-o noautoextattr" will cause _all_ extended attribute
> > > requests to go up to user space. Therefore, feel free to experiment
> > > and if something works for you, I'd be interested to hear about it.
>
> > I'd like to be able to experiment with this as a mount-time option,
> > but I can't make it work. I've added an extra option, a FUSE_MOPT
> > flag, an FSESS_ flag, etc., but it reports "unknown option". Are there
> > any gotchas I'm missing? Enclosed is the diff from the current
> > revision.
>
> > Index: macfuse/core/10.4/fusefs/fuse_internal.h
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/fuse_internal.h    (revision 433)
> > +++ macfuse/core/10.4/fusefs/fuse_internal.h    (working copy)
> > @@ -288,8 +288,12 @@
> >   */
> >  static __inline__
> >  int
> > -fuse_is_shortcircuit_xattr(const char *name)
> > +fuse_is_shortcircuit_xattr(vnode_t vp, const char *name)
> >  {
> > +    if (!(fuse_get_mpdata(vnode_mount(vp))->dataflags & 
> > FSESS_AUTOEXTATTR)) {
> > +        return 1;
> > +    }
> > +
> >      if (bcmp(name, XATTR_FINDERINFO_NAME,
> > sizeof(XATTR_FINDERINFO_NAME)) == 0) {
> >          return 1;
> >      }
> > Index: macfuse/core/10.4/fusefs/mount/mount_fusefs.c
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/mount/mount_fusefs.c       (revision 433)
> > +++ macfuse/core/10.4/fusefs/mount/mount_fusefs.c       (working copy)
> > @@ -47,6 +47,7 @@
> >      { "allow_other",         0, FUSE_MOPT_ALLOW_OTHER,            1 }, // 
> > kused
> >      { "allow_recursion",     0, FUSE_MOPT_ALLOW_RECURSION,        1 }, // 
> > uused
> >      { "allow_root",          0, FUSE_MOPT_ALLOW_ROOT,             1 }, // 
> > kused
> > +    { "autoextattr",         0, FUSE_MOPT_AUTOEXTATTR,            1 },
> >      { "blocksize=",          0, FUSE_MOPT_BLOCKSIZE,              1 }, // 
> > kused
> >      { "daemon_timeout=",     0, FUSE_MOPT_DAEMON_TIMEOUT,         1 }, // 
> > kused
> >      { "debug",               0, FUSE_MOPT_DEBUG,                  1 }, // 
> > kused
> > @@ -83,6 +84,7 @@
> >      { "authopaqueaccess",    1, FUSE_MOPT_NO_AUTH_OPAQUE_ACCESS,  1 }, // 
> > kused
> >      { "browse",              1, FUSE_MOPT_NO_BROWSE,              1 }, // 
> > kused
> >      { "localcaches",         1, FUSE_MOPT_NO_LOCALCACHES,         1 }, // 
> > kused
> > +    { "noautoextattr",       1, FUSE_MOPT_AUTOEXTATTR,            0 },
> >      { "noping_diskarb",      1, FUSE_MOPT_PING_DISKARB,           0 }, // 
> > kused
> >      { "readahead",           1, FUSE_MOPT_NO_READAHEAD,           1 }, // 
> > kused
> >      { "synconclose",         1, FUSE_MOPT_NO_SYNCONCLOSE,         1 }, // 
> > kused
> > @@ -923,6 +925,7 @@
> >        "    -o jail_symlinks       contain symbolic links within the 
> > mount\n"
> >        "    -o kill_on_unmount     kernel will send a signal (SIGKILL
> > by default) to the\n                           daemon after unmount
> > finishes\n"
> >        "    -o noapplespecial      ignore Apple Double (._) and
> > .DS_Store files entirely\n"
> > +      "    -o noautoextattr       specify that all xattr requests go
> > to userspace\n"
> >        "    -o noauthopaque        set MNTK_AUTH_OPAQUE in the kernel\n"
> >        "    -o noauthopaqueaccess  set MNTK_AUTH_OPAQUE_ACCESS in the 
> > kernel\n"
> >        "    -o nobrowse            set MNT_DONTBROWSE in the kernel\n"
> > Index: macfuse/core/10.4/fusefs/fuse_vnops.c
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/fuse_vnops.c       (revision 433)
> > +++ macfuse/core/10.4/fusefs/fuse_vnops.c       (working copy)
> > @@ -728,7 +728,7 @@
> >          return EINVAL;
> >      }
>
> > -    if (fuse_is_shortcircuit_xattr(ap->a_name)) {
> > +    if (fuse_is_shortcircuit_xattr(vp, ap->a_name)) {
> >          return ENOTSUP;
> >      }
>
> > @@ -2534,7 +2534,7 @@
> >          return (EINVAL);  /* invalid name */
> >      }
>
> > -    if (fuse_is_shortcircuit_xattr(ap->a_name)) {
> > +    if (fuse_is_shortcircuit_xattr(vp, ap->a_name)) {
> >          return ENOTSUP;
> >      }
>
> > @@ -3029,7 +3029,7 @@
> >          return EINVAL;
> >      }
>
> > -    if (fuse_is_shortcircuit_xattr(ap->a_name)) {
> > +    if (fuse_is_shortcircuit_xattr(vp, ap->a_name)) {
> >          return ENOTSUP;
> >      }
>
> > Index: macfuse/core/10.4/fusefs/fuse_ipc.h
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/fuse_ipc.h (revision 433)
> > +++ macfuse/core/10.4/fusefs/fuse_ipc.h (working copy)
> > @@ -213,6 +213,7 @@
> >  #define FSESS_NO_VNCACHE          0x00020000
> >  #define FSESS_NO_UBC              0x00040000
> >  #define FSESS_VOL_RENAME          0x00080000
> > +#define FSESS_AUTOEXTATTR         0x00100000
>
> >  static __inline__
> >  struct fuse_data *
> > Index: macfuse/core/10.4/fusefs/fuse_vfsops.c
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/fuse_vfsops.c      (revision 433)
> > +++ macfuse/core/10.4/fusefs/fuse_vfsops.c      (working copy)
> > @@ -264,6 +264,10 @@
> >          mntopts |= FSESS_NO_UBC;
> >      }
>
> > +    if (fusefs_args.altflags & FUSE_MOPT_AUTOEXTATTR) {
> > +        mntopts |= FSESS_AUTOEXTATTR;
> > +    }
> > +
> >      if (mntopts & FSESS_NO_UBC) {
> >          /* If no buffer cache, disallow exec from file system. */
> >          vfs_setflags(mp, MNT_NOEXEC);
> > Index: macfuse/core/10.4/fusefs/fusefs.xcodeproj/project.pbxproj
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/fusefs.xcodeproj/project.pbxproj   (revision 
> > 433)
> > +++ macfuse/core/10.4/fusefs/fusefs.xcodeproj/project.pbxproj   (working 
> > copy)
> > @@ -400,7 +400,6 @@
> >                 089C1669FE841209C02AAC07 /* Project object */ = {
> >                         isa = PBXProject;
> >                         buildConfigurationList =
> > 1DEB91C708733DAC0010E9CD /* Build configuration list for PBXProject
> > "fusefs" */;
> > -                       compatibilityVersion = "Xcode 2.4";
> >                         hasScannedForEncodings = 1;
> >                         mainGroup = 089C166AFE841209C02AAC07 /* fusefs */;
> >                         productRefGroup = 540966F20C33BEC900F5E227 /*
> > Products */;
> > Index: macfuse/core/10.4/fusefs/common/fuse_mount.h
> > ===================================================================
> > --- macfuse/core/10.4/fusefs/common/fuse_mount.h        (revision 433)
> > +++ macfuse/core/10.4/fusefs/common/fuse_mount.h        (working copy)
> > @@ -98,6 +98,7 @@
> >  #define FUSE_MOPT_VOLICON                0x0000008000000000ULL
> >  #define FUSE_MOPT_VOLNAME                0x0000010000000000ULL
> >  #define FUSE_MOPT_VOL_RENAME             0x0000020000000000ULL
> > +#define FUSE_MOPT_AUTOEXTATTR            0x0000040000000000ULL
>
> >  #define FUSE_MAKEDEV(x, y)              ((dev_t)(((x) << 24) | (y)))
> >  #define FUSE_MINOR_MASK                 0xFFFFFF


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"macfuse-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/macfuse-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to