Details : Reconnecting from a different nid causes old per-nid stats not to be
released.
+Severity : normal
+Bugzilla : 23064
+Description: create proper macro check for bdi interface.
+
-------------------------------------------------------------------------------
2010-10-29 Oracle, Inc.
])
])
-# 2.6.32 has new BDI interface.
-AC_DEFUN([LC_NEW_BACKING_DEV_INFO],
-[AC_MSG_CHECKING([if backing_dev_info has a bdi_list field])
+# 2.6.32 has bdi_register() functions.
+AC_DEFUN([LC_EXPORT_BDI_REGISTER],
+[LB_CHECK_SYMBOL_EXPORT([bdi_register],
+[mm/backing-dev.c],[
+ AC_DEFINE(HAVE_BDI_REGISTER, 1,
+ [bdi_register function is present])
+],[
+])
+])
+
+# 2.6.32 add s_bdi for super block
+AC_DEFUN([LC_SB_BDI],
+[AC_MSG_CHECKING([if super_block has s_bdi field])
LB_LINUX_TRY_COMPILE([
- #include <linux/backing-dev.h>
+ #include <linux/fs.h>
],[
- struct backing_dev_info bdi;
- memset(&bdi.bdi_list, 0x00, sizeof(bdi.bdi_list));
+ struct super_block sb;
+ sb.s_bdi = NULL;
],[
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_NEW_BACKING_DEV_INFO, 1,
- [backing_dev_info has a bdi_list field])
+ AC_DEFINE(HAVE_SB_BDI, 1,
+ [super_block has s_bdi field])
],[
AC_MSG_RESULT(no)
])
LC_BLK_QUEUE_LOG_BLK_SIZE
# 2.6.32
- LC_NEW_BACKING_DEV_INFO
+ LC_EXPORT_BDI_REGISTER
+ LC_SB_BDI
if test x$enable_server = xyes ; then
LC_WALK_SPACE_HAS_DATA_SEM
fi
struct ll_sb_info *lsi_llsbi; /* add'l client sbi info */
struct vfsmount *lsi_srv_mnt; /* the one server mount */
atomic_t lsi_mounts; /* references to the srv_mnt */
- struct backing_dev_info bdi; /* Each client mountpoint needs own backing_dev_info */
+ struct backing_dev_info lsi_bdi; /* each client mountpoint needs own backing_dev_info */
};
#define LSI_SERVER 0x00000001
#define LSI_UMOUNT_FORCE 0x00000010
#define LSI_UMOUNT_FAILOVER 0x00000020
+#define LSI_BDI_INITIALIZED 0x00000040
#define s2lsi(sb) ((struct lustre_sb_info *)((sb)->s_fs_info))
#define s2lsi_nocast(sb) ((sb)->s_fs_info)
}
/* end COMPAT_146 */
-#ifdef HAVE_NEW_BACKING_DEV_INFO
+#ifdef HAVE_BDI_REGISTER
static atomic_t ll_bdi_num = ATOMIC_INIT(0);
#endif
GOTO(out_free, err);
#ifdef HAVE_BDI_INIT
- err = bdi_init(&lsi->bdi);
+ err = bdi_init(&lsi->lsi_bdi);
if (err)
GOTO(out_free, err);
+ lsi->lsi_flags |= LSI_BDI_INITIALIZED;
+ lsi->lsi_bdi.capabilities = BDI_CAP_MAP_COPY;
+#ifdef HAVE_BDI_REGISTER
+ err = bdi_register(&lsi->lsi_bdi, NULL, "lustre-%d",
+ atomic_inc_return(&ll_bdi_num));
#endif
-#ifdef HAVE_NEW_BACKING_DEV_INFO
- lsi->bdi.name = "lustre";
- lsi->bdi.capabilities = BDI_CAP_MAP_COPY;
- err = bdi_register(&lsi->bdi, NULL, "lustre-%d",
- atomic_inc_return(&ll_bdi_num));
- sb->s_bdi = &lsi->bdi;
+#endif
+
+#ifdef HAVE_SB_BDI
+ sb->s_bdi = &lsi->lsi_bdi;
#endif
out_free:
if (profilenm)
class_del_profile(profilenm);
-#ifdef HAVE_NEW_BACKING_DEV_INFO
- if (lsi->bdi.wb_cnt > 0) {
-#endif
#ifdef HAVE_BDI_INIT
- bdi_destroy(&lsi->bdi);
-#endif
-#ifdef HAVE_NEW_BACKING_DEV_INFO
+ if (lsi->lsi_flags & LSI_BDI_INITIALIZED) {
+ bdi_destroy(&lsi->lsi_bdi);
+ lsi->lsi_flags &= ~LSI_BDI_INITIALIZED;
}
#endif
/* OIDEBUG(inode); */
/* initializing backing dev info. */
- inode->i_mapping->backing_dev_info = &(s2lsi(inode->i_sb)->bdi);
+ inode->i_mapping->backing_dev_info = &s2lsi(inode->i_sb)->lsi_bdi;
if (S_ISREG(inode->i_mode)) {
struct ll_sb_info *sbi = ll_i2sbi(inode);