* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <lustre_handles.h>
#include <lustre_intent.h>
#include <lvfs.h>
+#include <lustre_quota.h>
#define MAX_OBD_DEVICES 8192
*/
#define OBD_MAX_DEFAULT_EA_SIZE 4096
+enum obd_cl_sem_lock_class {
+ OBD_CLI_SEM_NORMAL,
+ OBD_CLI_SEM_MGC,
+ OBD_CLI_SEM_MDCOSC,
+};
+
struct mdc_rpc_lock;
struct obd_import;
struct client_obd {
unsigned long cl_dirty_transit; /* dirty synchronous */
unsigned long cl_avail_grant; /* bytes of credit for ost */
unsigned long cl_lost_grant; /* lost credits (trunc) */
+ /* grant consumed for dirty pages */
+ unsigned long cl_dirty_grant;
/* since we allocate grant by blocks, we don't know how many grant will
* be used to add a page into cache. As a solution, we reserve maximum
/* A chunk is an optimal size used by osc_extent to determine
* the extent size. A chunk is max(PAGE_CACHE_SIZE, OST block size) */
int cl_chunkbits;
- unsigned int cl_extent_tax; /* extent overhead, by bytes */
+ /* extent insertion metadata overhead to be accounted in grant,
+ * in bytes */
+ unsigned int cl_grant_extent_tax;
+ /* maximum extent size, in number of pages */
+ unsigned int cl_max_extent_pages;
/* keep track of objects that have lois that contain pages which
* have been queued for async brw. this lock also protects the
void *cl_writeback_work;
void *cl_lru_work;
/* hash tables for osc_quota_info */
- struct cfs_hash *cl_quota_hash[MAXQUOTAS];
+ struct cfs_hash *cl_quota_hash[LL_MAXQUOTAS];
};
#define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)
unsigned long ltd_active:1; /* target up for requests */
};
-enum placement_policy {
- PLACEMENT_CHAR_POLICY = 0,
- PLACEMENT_NID_POLICY = 1,
- PLACEMENT_INVAL_POLICY = 2,
- PLACEMENT_MAX_POLICY
-};
-
-typedef enum placement_policy placement_policy_t;
-
struct lmv_obd {
- int refcount;
struct lu_client_fld lmv_fld;
spinlock_t lmv_lock;
- placement_policy_t lmv_placement;
struct lmv_desc desc;
struct obd_uuid cluuid;
- struct obd_export *exp;
struct proc_dir_entry *targets_proc_entry;
struct mutex lmv_init_mutex;
OBD_NOTIFY_ACTIVE,
/* Device deactivated */
OBD_NOTIFY_INACTIVE,
- /* Device disconnected */
- OBD_NOTIFY_DISCON,
/* Connect data for import were changed */
OBD_NOTIFY_OCD,
/* Sync request */
* (for /proc/status only!!) */
obd_no_ir:1, /* no imperative recovery. */
obd_process_conf:1, /* device is processing mgs config */
- obd_uses_nid_stats:1, /* maintain per-client OBD stats */
- obd_force_abort_recovery:1; /* abort recovery forcely */
+ obd_uses_nid_stats:1; /* maintain per-client OBD stats */
/* use separate field as it is set in interrupt to don't mess with
* protection of other bits using _bh lock */
#ifdef CONFIG_FS_POSIX_ACL
struct posix_acl *posix_acl;
#endif
- struct mdt_remote_perm *remote_perm;
};
struct md_open_data {
#define MD_STATS_LAST_OP m_revalidate_lock
- int (*m_getstatus)(struct obd_export *, struct lu_fid *);
+ int (*m_get_root)(struct obd_export *, const char *, struct lu_fid *);
int (*m_null_inode)(struct obd_export *, const struct lu_fid *);
- int (*m_find_cbdata)(struct obd_export *, const struct lu_fid *,
- ldlm_iterator_t, void *);
-
int (*m_getattr_name)(struct obd_export *, struct md_op_data *,
struct ptlrpc_request **);
int (*m_clear_open_replay_data)(struct obd_export *,
struct obd_client_handle *);
- int (*m_set_lock_data)(struct obd_export *, __u64 *, void *, __u64 *);
+ int (*m_set_lock_data)(struct obd_export *,
+ const struct lustre_handle *, void *, __u64 *);
enum ldlm_mode (*m_lock_match)(struct obd_export *, __u64,
const struct lu_fid *, enum ldlm_type,
union ldlm_policy_data *, enum ldlm_mode,
enum ldlm_cancel_flags flags, void *opaque);
- int (*m_get_remote_perm)(struct obd_export *, const struct lu_fid *,
- u32, struct ptlrpc_request **);
-
int (*m_get_fid_from_lsm)(struct obd_export *,
const struct lmv_stripe_md *,
const char *name, int namelen,