#ifdef HAVE_INODE_TIMESPEC64
# define osd_timespec timespec64
-# define osd_timespec_trunc(ts, gran) timespec64_trunc((ts), (gran))
#else
# define osd_timespec timespec
-# define osd_timespec_trunc(ts, gran) timespec_trunc((ts), (gran))
#endif
static inline struct osd_timespec osd_inode_time(struct inode *inode,
{
struct osd_timespec ts = { .tv_sec = seconds };
- return osd_timespec_trunc(ts, inode->i_sb->s_time_gran);
+ return ts;
}
#define OSD_INS_CACHE_SIZE 8
static inline struct osd_device *osd_dt_dev(const struct dt_device *d)
{
- LASSERT(lu_device_is_osd(&d->dd_lu_dev));
- return container_of0(d, struct osd_device, od_dt_dev);
+ LASSERT(lu_device_is_osd(&d->dd_lu_dev));
+ return container_of(d, struct osd_device, od_dt_dev);
}
static inline struct osd_device *osd_dev(const struct lu_device *d)
{
- LASSERT(lu_device_is_osd(d));
- return osd_dt_dev(container_of0(d, struct dt_device, dd_lu_dev));
+ LASSERT(lu_device_is_osd(d));
+ return osd_dt_dev(container_of(d, struct dt_device, dd_lu_dev));
}
static inline struct osd_device *osd_obj2dev(const struct osd_object *o)
static inline struct osd_object *osd_obj(const struct lu_object *o)
{
- LASSERT(lu_device_is_osd(o->lo_dev));
- return container_of0(o, struct osd_object, oo_dt.do_lu);
+ LASSERT(lu_device_is_osd(o->lo_dev));
+ return container_of(o, struct osd_object, oo_dt.do_lu);
}
static inline struct osd_object *osd_dt_obj(const struct dt_object *d)
oh->ot_credits += credits;
}
+/* linux: v5.4-rc3-21-g933f1c1e0b75 renamed h_buffer_credits */
+#ifdef HAVE_JOURNAL_TOTAL_CREDITS
+#define h_buffer_credits h_total_credits
+#endif
+
static inline void osd_trans_exec_op(const struct lu_env *env,
struct thandle *th,
enum osd_op_type op)