])
#
-# 2.6.38 vfsmount.mnt_count doesn't use atomic_t
-#
-# 3.3 starts hiding vfsmount guts series (move from include/linux/mount.h to
-# fs/mount.h, see kernel commit 7d6fec45a5131918b51dcd76da52f2ec86a85be6)
-#
-AC_DEFUN([LC_ATOMIC_MNT_COUNT],
-[AC_MSG_CHECKING([if vfsmount guts is hidden, or vfsmount.mnt_count is atomic_t.])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <../fs/mount.h>
-],[
- struct mount *mnt = real_mount((struct vfsmount *)0);
-],[
- AC_DEFINE(HAVE_HIDE_VFSMOUNT_GUTS, 1,
- [hide vfsmount guts in fs/mount.h])
- AC_MSG_RESULT([yes, hide vfsmount guts in fs/mount.h])
-],[
- LB_LINUX_TRY_COMPILE([
- #include <asm/atomic.h>
- #include <linux/fs.h>
- #include <linux/mount.h>
- ],[
- ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
- ],[
- AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
- [vfsmount.mnt_count is atomic_t])
- AC_MSG_RESULT([yes, vfsmount.mnt_count is atomic_t])
- ],[
- AC_MSG_RESULT([no])
- ])
-])
-])
-
-#
# 2.6.38 use path as 4th parameter in quota_on.
#
AC_DEFUN([LC_QUOTA_ON_USE_PATH],
LC_KERNEL_LOCKED
# 2.6.38
- LC_ATOMIC_MNT_COUNT
LC_BLKDEV_GET_BY_DEV
LC_GENERIC_PERMISSION
LC_QUOTA_ON_USE_PATH
# define inode_dio_done(i) up_read(&(i)->i_alloc_sem)
#endif
-#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;
-
- for_each_possible_cpu(cpu) {
- count += per_cpu_ptr(real_mount(mnt)->mnt_pcp, cpu)->mnt_count;
- }
-
- return count;
-#else
- return real_mount(mnt)->mnt_count;
-#endif
-}
-#else
-# define mnt_get_count(mnt) cfs_atomic_read(&(real_mount(mnt)->mnt_count))
-#endif
-
#ifdef HAVE_RW_TREE_LOCK
#define TREE_READ_LOCK_IRQ(mapping) read_lock_irq(&(mapping)->tree_lock)
#define TREE_READ_UNLOCK_IRQ(mapping) read_unlock_irq(&(mapping)->tree_lock)
#define get_profile_name(sb) (s2lsi(sb)->lsi_lmd->lmd_profile)
#define get_mount_flags(sb) (s2lsi(sb)->lsi_lmd->lmd_flags)
+#define get_mntdev_name(sb) (s2lsi(sb)->lsi_lmd->lmd_dev)
#endif /* __KERNEL__ */
#include <lprocfs_status.h>
#include <lustre_fsfilt.h>
#include <lustre_log.h>
+#include <lustre_disk.h>
#include <lustre/lustre_idl.h>
#include <dt_object.h>
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
+ struct lustre_mount_info *lmi;
+ const char *dev_name;
LASSERT(obd != NULL);
- LASSERT(mnt_get_devname(obd->u.obt.obt_vfsmnt));
+ lmi = server_get_mount_2(obd->obd_name);
+ dev_name = get_mntdev_name(lmi->lmi_sb);
+ LASSERT(dev_name != NULL);
*eof = 1;
- return snprintf(page, count, "%s\n",
- mnt_get_devname(obd->u.obt.obt_vfsmnt));
+ server_put_mount_2(obd->obd_name, lmi->lmi_mnt);
+ return snprintf(page, count, "%s\n", dev_name);
}
EXPORT_SYMBOL(lprocfs_obd_rd_mntdev);
if (o->od_mnt != NULL)
RETURN(0);
+ if (strlen(dev) >= sizeof(o->od_mntdev))
+ RETURN(-E2BIG);
+ strcpy(o->od_mntdev, dev);
+
o->od_fsops = fsfilt_get_ops(mt_str(LDD_MT_LDISKFS));
if (o->od_fsops == NULL) {
CERROR("Can't find fsfilt_ldiskfs\n");
/* service name associated with the osd device */
char od_svname[MAX_OBD_NAME];
+ char od_mntdev[MAX_OBD_NAME];
/* quota slave instance */
struct qsd_instance *od_quota_slave;
if (unlikely(osd->od_mnt == NULL))
return -EINPROGRESS;
- LASSERT(mnt_get_devname(osd->od_mnt));
*eof = 1;
- return snprintf(page, count, "%s\n",
- mnt_get_devname(osd->od_mnt));
+ return snprintf(page, count, "%s\n", osd->od_mntdev);
}
static int lprocfs_osd_rd_cache(char *page, char **start, off_t off,