Re: [PATCH -V2] Generic name to handle and open by handle syscalls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2010-03-18, at 11:09, Aneesh Kumar K.V wrote:
Example program:
int main(int argc, char *argv[])
{
       ret = syscall(338, argv[1], &fh);
       if (ret) {
               perror("Error:");
               exit(1);
       }
       dirfd = open("/", O_RDONLY|O_DIRECTORY);
       fd = syscall(339, dirfd, &fh, O_RDONLY);


For your example program, it would be useful to include the
system calls so it is easier to see what is going on, like:

#ifndef HAVE_NAME_TO_HANDLE
static inline int name_to_handle(const char *name, struct file_handle *fh)
{
        return syscall(338, name, fh);
}

static inline int open_by_handle(int dirfd, struct file_handle *fh, int flags)
{
        return syscall(339, dirfd, fh, flags);
}
#endif

int main(...)
{
        ret = name_to_handle(argv[1], &fh);
        :

        dirfd = open("/", O_RDONLY|O_DIRECTORY);
        fd = open_by_handle(dirfd, &fh, O_RDONLY);
        :
        :
}

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux