#ifndef __OBD_H
#define __OBD_H
+#include <linux/fs.h>
+#include <linux/posix_acl.h>
#include <linux/kobject.h>
#include <linux/spinlock.h>
#include <linux/sysfs.h>
+#include <linux/xarray.h>
#include <uapi/linux/lustre/lustre_idl.h>
#include <lustre_lib.h>
struct kobject typ_kobj;
};
#define typ_name typ_kobj.name
+#define OBD_LU_TYPE_SETUP ((void *)0x01UL)
struct brw_page {
u64 off;
struct page *pg;
u32 count;
u32 flag;
+ /* used for encryption: difference with offset in clear text page */
+ u16 bp_off_diff;
+ /* used for encryption: difference with count in clear text page */
+ u16 bp_count_diff;
+ u32 bp_padding;
};
struct timeout_item {
obd_abort_recovery:1, /* recovery expired */
obd_version_recov:1, /* obd uses version checking */
obd_replayable:1, /* recovery enabled; inform clients */
- obd_no_transno:1, /* no committed-transno notification */
obd_no_recov:1, /* fail instead of retry messages */
obd_stopping:1, /* started cleanup */
obd_starting:1, /* started setup */
obd_no_ir:1, /* no imperative recovery. */
obd_process_conf:1, /* device is processing mgs config */
obd_checksum_dump:1; /* dump pages upon cksum error */
+#ifdef HAVE_SERVER_SUPPORT
+ /* no committed-transno notification */
+ unsigned long obd_no_transno:1;
+#endif
/* use separate field as it is set in interrupt to don't mess with
* protection of other bits using _bh lock */
/* uuid-export hash body */
struct rhashtable obd_uuid_hash;
/* nid-export hash body */
- struct cfs_hash *obd_nid_hash;
+ struct rhltable obd_nid_hash;
/* nid stats body */
struct cfs_hash *obd_nid_stats_hash;
/* client_generation-export hash body */
time64_t obd_recovery_start;
/* seconds, for lprocfs_status */
time64_t obd_recovery_end;
- /* To tell timeouts from time stamps Lustre uses time_t
+ /* To tell timeouts from time stamps Lustre uses timeout_t
* instead of time64_t.
*/
- time_t obd_recovery_time_hard;
- time_t obd_recovery_timeout;
- int obd_recovery_ir_factor;
+ timeout_t obd_recovery_time_hard;
+ timeout_t obd_recovery_timeout;
+ int obd_recovery_ir_factor;
/* new recovery stuff from CMD2 */
int obd_replayed_locks;
#ifdef HAVE_SERVER_SUPPORT
struct obd_export *obd_uuid_lookup(struct obd_device *obd,
struct obd_uuid *uuid);
+
+int obd_nid_export_for_each(struct obd_device *obd, lnet_nid_t nid,
+ int cb(struct obd_export *exp, void *data),
+ void *data);
+int obd_nid_add(struct obd_device *obd, struct obd_export *exp);
+void obd_nid_del(struct obd_device *obd, struct obd_export *exp);
#endif
/* get/set_info keys */
}
enum md_op_flags {
- MF_MDC_CANCEL_FID1 = 1 << 0,
- MF_MDC_CANCEL_FID2 = 1 << 1,
- MF_MDC_CANCEL_FID3 = 1 << 2,
- MF_MDC_CANCEL_FID4 = 1 << 3,
- MF_GET_MDT_IDX = 1 << 4,
+ MF_MDC_CANCEL_FID1 = BIT(0),
+ MF_MDC_CANCEL_FID2 = BIT(1),
+ MF_MDC_CANCEL_FID3 = BIT(2),
+ MF_MDC_CANCEL_FID4 = BIT(3),
+ MF_GET_MDT_IDX = BIT(4),
};
enum md_cli_flags {
- CLI_SET_MEA = 1 << 0,
- CLI_RM_ENTRY = 1 << 1,
- CLI_HASH64 = 1 << 2,
- CLI_API32 = 1 << 3,
- CLI_MIGRATE = 1 << 4,
- CLI_DIRTY_DATA = 1 << 5,
+ CLI_SET_MEA = BIT(0),
+ CLI_RM_ENTRY = BIT(1),
+ CLI_HASH64 = BIT(2),
+ CLI_API32 = BIT(3),
+ CLI_MIGRATE = BIT(4),
+ CLI_DIRTY_DATA = BIT(5),
};
enum md_op_code {
#endif
};
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
+static inline void lmd_clear_acl(struct lustre_md *md)
+{
+ if (md->posix_acl) {
+ posix_acl_release(md->posix_acl);
+ md->posix_acl = NULL;
+ }
+}
+
+#define OBD_CONNECT_ACL_FLAGS \
+ (OBD_CONNECT_ACL | OBD_CONNECT_UMASK | OBD_CONNECT_LARGE_ACL)
+#else
+static inline void lmd_clear_acl(struct lustre_md *md)
+{
+}
+
+#define OBD_CONNECT_ACL_FLAGS (0)
+#endif
+
struct md_open_data {
struct obd_client_handle *mod_och;
struct ptlrpc_request *mod_open_req;
int (*m_free_lustre_md)(struct obd_export *, struct lustre_md *);
- int (*m_merge_attr)(struct obd_export *,
+ int (*m_merge_attr)(struct obd_export *, const struct lu_fid *fid,
const struct lmv_stripe_md *lsm,
struct cl_attr *attr, ldlm_blocking_callback);
1 << (20 - PAGE_SHIFT));
}
+static inline struct inode *page2inode(struct page *page)
+{
+ if (page->mapping) {
+ if (PageAnon(page))
+ return NULL;
+ else
+ return page->mapping->host;
+ } else {
+ return NULL;
+ }
+}
+
#endif /* __OBD_H */