LOOKUP_ACCESS

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

LOOKUP_ACCESS

Christian Magnusson

Hi Miklos,

I was updating me cvs-source, and I noticed you have added som new
features in fuse/kernel/dir.c

  if (nd && ((nd->flags & LOOKUP_ACCESS) ||
       ((nd->flags & LOOKUP_OPEN) && mode != 0)))
          err = fuse_access(inode, mask);


LOOKUP_ACCESS and LOOKUP_OPEN exists on my Fedora core 4 desktop in
/usr/src/linux-2.6.12-1.1398_FC4-i686/include/linux/namei.h

But for all my other platforms linux/include/linux/namei.h doesn't
exist, such as:
x86: /usr/src/linux-2.4.22-1.2197.nptl/include/linux/
mips: /usr/src/linux-2.4.30/include/linux/
uClinux: /usr/src/linux-2.4.27-uc1/include/linux/


You make the test before including the file...
#ifdef KERNEL_2_6_8_PLUS
#include <linux/namei.h>
#endif

but shouldn't you test something like this before using the defines..

#ifdef _LINUX_NAMEI_H   (or KERNEL_2_6_8_PLUS)
                if (nd &&
                    ((nd->flags & LOOKUP_ACCESS) ||
                     ((nd->flags & LOOKUP_OPEN) && mode != 0)))
                        err = fuse_access(inode, mask);
#endif



--
Christian Magnusson <[hidden email]>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: LOOKUP_ACCESS

Miklos Szeredi
> I was updating me cvs-source, and I noticed you have added som new
> features in fuse/kernel/dir.c
>
>   if (nd && ((nd->flags & LOOKUP_ACCESS) ||
>        ((nd->flags & LOOKUP_OPEN) && mode != 0)))
>           err = fuse_access(inode, mask);
>
>
> LOOKUP_ACCESS and LOOKUP_OPEN exists on my Fedora core 4 desktop in
> /usr/src/linux-2.6.12-1.1398_FC4-i686/include/linux/namei.h
>
> But for all my other platforms linux/include/linux/namei.h doesn't
> exist, such as:
> x86: /usr/src/linux-2.4.22-1.2197.nptl/include/linux/
> mips: /usr/src/linux-2.4.30/include/linux/
> uClinux: /usr/src/linux-2.4.27-uc1/include/linux/
>
>
> You make the test before including the file...
> #ifdef KERNEL_2_6_8_PLUS
> #include <linux/namei.h>
> #endif
>
> but shouldn't you test something like this before using the defines..
>
> #ifdef _LINUX_NAMEI_H   (or KERNEL_2_6_8_PLUS)
>                 if (nd &&
>                     ((nd->flags & LOOKUP_ACCESS) ||
>                      ((nd->flags & LOOKUP_OPEN) && mode != 0)))
>                         err = fuse_access(inode, mask);
> #endif
>

Yes.  I didn't test on 2.4 (or earlier 2.6 kernels) at all.  I will do
so now, thanks for the reminder.

Miklos


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel