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

From: Trond Myklebust (
Date: Mon May 08 2000 - 07:57:49 EST

>>>>> " " == Tigran Aivazian <> 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.prev == &s_mounts
if not then points to the first mount instance.

i.e. you need something like

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


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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