struct list_head oo_xattr_list;
struct lu_object_header *oo_header;
+ __u64 oo_dirent_count;
};
struct osd_obj_seq {
enum osd_op_type {
OSD_OT_ATTR_SET = 0,
- OSD_OT_PUNCH = 1,
- OSD_OT_XATTR_SET = 2,
- OSD_OT_CREATE = 3,
- OSD_OT_DESTROY = 4,
- OSD_OT_REF_ADD = 5,
- OSD_OT_REF_DEL = 6,
- OSD_OT_WRITE = 7,
- OSD_OT_INSERT = 8,
- OSD_OT_DELETE = 9,
- OSD_OT_QUOTA = 10,
- OSD_OT_MAX = 11
+ OSD_OT_PUNCH,
+ OSD_OT_XATTR_SET,
+ OSD_OT_CREATE,
+ OSD_OT_DESTROY,
+ OSD_OT_REF_ADD,
+ OSD_OT_REF_DEL,
+ OSD_OT_WRITE,
+ OSD_OT_INSERT,
+ OSD_OT_DELETE,
+ OSD_OT_QUOTA,
+ OSD_OT_PREALLOC,
+ OSD_OT_MAX
};
struct osd_access_lock {
#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)
int osd_trunc_lock(struct osd_object *obj, struct osd_thandle *oh,
bool shared);
-void osd_trunc_unlock_all(struct list_head *list);
+void osd_trunc_unlock_all(const struct lu_env *env, struct list_head *list);
void osd_process_truncates(struct list_head *list);
void osd_execute_truncate(struct osd_object *obj);