fi
])
-AC_DEFUN([LC_PERCPU_COUNTER],
-[AC_MSG_CHECKING([if have struct percpu_counter defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/percpu_counter.h>
-],[],[
- AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
- AC_MSG_RESULT([yes])
-
- AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
- LB_LINUX_TRY_COMPILE([
- #include <linux/percpu_counter.h>
- ],[
- struct percpu_counter c;
- percpu_counter_init(&c, 0);
- ],[
- AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
- arguments])
- AC_MSG_RESULT([yes])
- ],[
- AC_MSG_RESULT([no])
- ])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
AC_DEFUN([LC_TASK_CLENV_STORE],
[
AC_MSG_CHECKING([if we can store cl_env in task_struct])
fi
])
-# ~2.6.11
-
-AC_DEFUN([LC_S_TIME_GRAN],
-[AC_MSG_CHECKING([if super block has s_time_gran member])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- struct super_block *sb = NULL;
-
- return sb->s_time_gran;
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-AC_DEFUN([LC_SB_TIME_GRAN],
-[AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- return get_sb_time_gran(NULL);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
# 2.6.12
# ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
LC_CAPA_CRYPTO
LC_CONFIG_RMTCLIENT
LC_CONFIG_GSS
- LC_PERCPU_COUNTER
LC_TASK_CLENV_STORE
- # ~2.6.11
- LC_S_TIME_GRAN
- LC_SB_TIME_GRAN
-
# 2.6.12
LC_RW_TREE_LOCK
#define ll_do_statfs(sb, sfs) (sb)->s_op->statfs((sb), (sfs))
#endif
-#ifndef HAVE_SB_TIME_GRAN
-#ifndef HAVE_S_TIME_GRAN
-#error Need s_time_gran patch!
-#endif
-static inline u32 get_sb_time_gran(struct super_block *sb)
-{
- return sb->s_time_gran;
-}
-#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)
}
static struct timespec *osd_inode_time(const struct lu_env *env,
- struct inode *inode, __u64 seconds)
+ struct inode *inode, __u64 seconds)
{
- struct osd_thread_info *oti = osd_oti_get(env);
- struct timespec *t = &oti->oti_time;
+ struct osd_thread_info *oti = osd_oti_get(env);
+ struct timespec *t = &oti->oti_time;
- t->tv_sec = seconds;
- t->tv_nsec = 0;
- *t = timespec_trunc(*t, get_sb_time_gran(inode->i_sb));
- return t;
+ t->tv_sec = seconds;
+ t->tv_nsec = 0;
+ *t = timespec_trunc(*t, inode->i_sb->s_time_gran);
+ return t;
}