Re: finding 'struct vfsmount' by given 'struct super_block'

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Mon May 08 2000 - 07:57:49 EST


>>>>> " " == Tigran Aivazian <tigran@veritas.com> writes:

> mnt = list_entry(sb->s_mounts, struct vfsmount,
> mnt_instances);

> then it won't compile because of "cannot convert to a pointer
> type" error.

That's because s_mounts is the list head. If it is empty, then
     s_mounts.next == s_mounts.prev == &s_mounts
if not then s_mounts.next points to the first mount instance.

i.e. you need something like

    if (!list_empty(&sb->s_mounts))
        mnt = list_entry(sb->s_mounts.next, struct vfsmount, mnt_instances);

Cheers,
  Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:11 EST