#include <linux/mpage.h> /* for generic_writepages */
+#ifdef HAVE_HIDE_VFSMOUNT_GUTS
+# include <../fs/mount.h>
+#else
+# define real_mount(mnt) (mnt)
+#endif
+
+static inline const char *mnt_get_devname(struct vfsmount *mnt)
+{
+ return real_mount(mnt)->mnt_devname;
+}
+
#ifndef HAVE_ATOMIC_MNT_COUNT
static inline unsigned int mnt_get_count(struct vfsmount *mnt)
{
#ifdef CONFIG_SMP
- unsigned int count = 0;
- int cpu;
+ unsigned int count = 0;
+ int cpu;
- for_each_possible_cpu(cpu) {
- count += per_cpu_ptr(mnt->mnt_pcp, cpu)->mnt_count;
- }
+ for_each_possible_cpu(cpu) {
+ count += per_cpu_ptr(real_mount(mnt)->mnt_pcp, cpu)->mnt_count;
+ }
- return count;
+ return count;
#else
- return mnt->mnt_count;
+ return real_mount(mnt)->mnt_count;
#endif
}
#else
-# define mnt_get_count(mnt) cfs_atomic_read(&mnt->mnt_count)
+# define mnt_get_count(mnt) cfs_atomic_read(&(real_mount(mnt)->mnt_count))
#endif
#ifdef HAVE_STATFS_DENTRY_PARAM