} \
})
-void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid);
+void obdo_from_inode(struct obdo *dst, struct inode *src, u64 valid);
void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent);
/* return 1 if client should be resend request */
struct lu_attr;
struct inode;
-void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid);
-void la_from_obdo(struct lu_attr *la, const struct obdo *dst, u32 valid);
+void obdo_from_la(struct obdo *dst, const struct lu_attr *la, u64 valid);
+void la_from_obdo(struct lu_attr *la, const struct obdo *dst, u64 valid);
-void obdo_cpy_md(struct obdo *dst, const struct obdo *src, u32 valid);
+void obdo_cpy_md(struct obdo *dst, const struct obdo *src, u64 valid);
void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj);
#define OBT(dev) (dev)->obd_type
{
struct inode *inode;
struct obdo *oa;
- u32 valid_flags;
+ u64 valid_flags = OBD_MD_FLTYPE;
oa = attr->cra_oa;
inode = vvp_object_inode(obj);
- valid_flags = OBD_MD_FLTYPE;
if ((flags & OBD_MD_FLOSSCAPA) != 0) {
LASSERT(attr->cra_capa == NULL);
#include <obd_class.h>
/*FIXME: Just copy from obdo_from_inode*/
-void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid)
+void obdo_from_la(struct obdo *dst, const struct lu_attr *la, u64 valid)
{
- u32 newvalid = 0;
+ u64 newvalid = 0;
if (valid & LA_ATIME) {
dst->o_atime = la->la_atime;
EXPORT_SYMBOL(obdo_from_la);
/*FIXME: Just copy from obdo_from_inode*/
-void la_from_obdo(struct lu_attr *dst, const struct obdo *obdo, u32 valid)
+void la_from_obdo(struct lu_attr *dst, const struct obdo *obdo, u64 valid)
{
- __u64 newvalid = 0;
+ u64 newvalid = 0;
valid &= obdo->o_valid;
/* WARNING: the file systems must take care not to tinker with
attributes they don't manage (such as blocks). */
-void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)
+void obdo_from_inode(struct obdo *dst, struct inode *src, u64 valid)
{
- u32 newvalid = 0;
+ u64 newvalid = 0;
- if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n",
- valid, LTIME_S(src->i_mtime),
- LTIME_S(src->i_ctime));
+ if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
+ CDEBUG(D_INODE, "valid "LPX64", new time %lu/%lu\n",
+ valid, LTIME_S(src->i_mtime),
+ LTIME_S(src->i_ctime));
if (valid & OBD_MD_FLATIME) {
dst->o_atime = LTIME_S(src->i_atime);
}
EXPORT_SYMBOL(obdo_from_inode);
-void obdo_cpy_md(struct obdo *dst, const struct obdo *src, u32 valid)
+void obdo_cpy_md(struct obdo *dst, const struct obdo *src, u64 valid)
{
CDEBUG(D_INODE, "src obdo "DOSTID" valid "LPX64", dst obdo "DOSTID"\n",
POSTID(&src->o_oi), src->o_valid, POSTID(&dst->o_oi));
int nr_pages = ext->oe_nr_pages;
int lost_grant = 0;
int blocksize = cli->cl_import->imp_obd->obd_osfs.os_bsize ? : 4096;
- __u64 last_off = 0;
+ loff_t last_off = 0;
int last_count = -1;
ENTRY;
pgoff_t index;
unsigned int tmp;
unsigned int grants = 0;
- int brw_flags = OBD_BRW_ASYNC;
+ u32 brw_flags = OBD_BRW_ASYNC;
int cmd = OBD_BRW_WRITE;
int need_release = 0;
int rc = 0;
enum cl_req_type crt, int brw_flags);
int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops);
int osc_set_async_flags(struct osc_object *obj, struct osc_page *opg,
- obd_flag async_flags);
+ u32 async_flags);
int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops,
struct page *page, loff_t offset);
int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
struct list_head oap_pending_item;
struct list_head oap_rpc_item;
- obd_off oap_obj_off;
+ loff_t oap_obj_off;
unsigned oap_page_off;
enum async_flags oap_async_flags;
struct osc_quota_info {
/** linkage for quota hash table */
struct hlist_node oqi_hash;
- obd_uid oqi_id;
+ u32 oqi_id;
};
struct osc_async_args {
int osc_quota_setup(struct obd_device *obd);
int osc_quota_cleanup(struct obd_device *obd);
int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
- obd_flag valid, obd_flag flags);
+ u64 valid, u32 flags);
int osc_quota_chkdq(struct client_obd *cli, const unsigned int qid[]);
int osc_quotactl(struct obd_device *unused, struct obd_export *exp,
struct obd_quotactl *oqctl);
static void osc_req_attr_set(const struct lu_env *env,
const struct cl_req_slice *slice,
const struct cl_object *obj,
- struct cl_req_attr *attr, obd_valid flags)
+ struct cl_req_attr *attr, u64 flags)
{
struct lov_oinfo *oinfo;
struct cl_req *clerq;
return (*printer)(env, cookie, LUSTRE_OSC_NAME"-page@%p %lu: "
"1< %#x %d %u %s %s > "
- "2< "LPU64" %u %u %#x %#x | %p %p %p > "
+ "2< "LPD64" %u %u %#x %#x | %p %p %p > "
"3< %s %p %d %lu %d > "
"4< %d %d %d %lu %s | %s %s %s %s > "
"5< %s %s %s %s | %d %s | %d %s %s>\n",
static inline void unstable_page_accounting(struct ptlrpc_bulk_desc *desc,
int factor)
{
- obd_count page_count = desc->bd_iov_count;
+ int page_count = desc->bd_iov_count;
void *zone = NULL;
int count = 0;
int i;
#include <obd.h>
#include "osc_internal.h"
-static inline struct osc_quota_info *osc_oqi_alloc(obd_uid id)
+static inline struct osc_quota_info *osc_oqi_alloc(u32 id)
{
struct osc_quota_info *oqi;
: OBD_FL_NO_GRPQUOTA)
int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
- obd_flag valid, obd_flag flags)
+ u64 valid, u32 flags)
{
int type;
int rc = 0;
oqi_keycmp(const void *key, struct hlist_node *hnode)
{
struct osc_quota_info *oqi;
- obd_uid uid;
+ u32 uid;
LASSERT(key != NULL);
- uid = *((obd_uid*)key);
+ uid = *((u32 *)key);
oqi = hlist_entry(hnode, struct osc_quota_info, oqi_hash);
return uid == oqi->oqi_id;
struct obdo *aa_oa;
int aa_requested_nob;
int aa_nio_count;
- obd_count aa_page_count;
+ u32 aa_page_count;
int aa_resends;
struct brw_page **aa_ppga;
struct client_obd *aa_cli;
unsigned int oa_agl:1;
};
-static void osc_release_ppga(struct brw_page **ppga, obd_count count);
+static void osc_release_ppga(struct brw_page **ppga, size_t count);
static int brw_interpret(const struct lu_env *env, struct ptlrpc_request *req,
void *data, int rc);
static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,
long writing_bytes)
{
- obd_flag bits = OBD_MD_FLBLOCKS|OBD_MD_FLGRANT;
+ u64 bits = OBD_MD_FLBLOCKS | OBD_MD_FLGRANT;
- LASSERT(!(oa->o_valid & bits));
+ LASSERT(!(oa->o_valid & bits));
oa->o_valid |= bits;
spin_lock(&cli->cl_loi_list_lock);
cli->cl_next_shrink_grant);
}
-static void __osc_update_grant(struct client_obd *cli, obd_size grant)
+static void __osc_update_grant(struct client_obd *cli, u64 grant)
{
spin_lock(&cli->cl_loi_list_lock);
cli->cl_avail_grant += grant;
}
static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
- obd_count keylen, void *key, obd_count vallen,
- void *val, struct ptlrpc_request_set *set);
+ u32 keylen, void *key,
+ u32 vallen, void *val,
+ struct ptlrpc_request_set *set);
static int osc_shrink_grant_interpret(const struct lu_env *env,
struct ptlrpc_request *req,
* beyond the end of a stripe file; i.e. lustre is reading a sparse file
* via the LOV, and it _knows_ it's reading inside the file, it's just that
* this stripe never got written at or beyond this stripe offset yet. */
-static void handle_short_read(int nob_read, obd_count page_count,
+static void handle_short_read(int nob_read, size_t page_count,
struct brw_page **pga)
{
char *ptr;
}
static int check_write_rcs(struct ptlrpc_request *req,
- int requested_nob, int niocount,
- obd_count page_count, struct brw_page **pga)
+ int requested_nob, int niocount,
+ size_t page_count, struct brw_page **pga)
{
int i;
__u32 *remote_rcs;
return (p1->off + p1->count == p2->off);
}
-static obd_count osc_checksum_bulk(int nob, obd_count pg_count,
- struct brw_page **pga, int opc,
- cksum_type_t cksum_type)
+static u32 osc_checksum_bulk(int nob, size_t pg_count,
+ struct brw_page **pga, int opc,
+ cksum_type_t cksum_type)
{
- __u32 cksum;
+ u32 cksum;
int i = 0;
struct cfs_crypto_hash_desc *hdesc;
unsigned int bufsize;
}
static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
- struct lov_stripe_md *lsm, obd_count page_count,
- struct brw_page **pga,
- struct ptlrpc_request **reqp,
- struct obd_capa *ocapa, int reserve,
- int resend)
+ struct lov_stripe_md *lsm, u32 page_count,
+ struct brw_page **pga,
+ struct ptlrpc_request **reqp,
+ struct obd_capa *ocapa, int reserve,
+ int resend)
{
struct ptlrpc_request *req;
struct ptlrpc_bulk_desc *desc;
}
static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer,
- __u32 client_cksum, __u32 server_cksum, int nob,
- obd_count page_count, struct brw_page **pga,
- cksum_type_t client_cksum_type)
+ __u32 client_cksum, __u32 server_cksum, int nob,
+ size_t page_count, struct brw_page **pga,
+ cksum_type_t client_cksum_type)
{
__u32 new_cksum;
char *msg;
} while (stride > 1);
}
-static void osc_release_ppga(struct brw_page **ppga, obd_count count)
+static void osc_release_ppga(struct brw_page **ppga, size_t count)
{
LASSERT(ppga != NULL);
OBD_FREE(ppga, sizeof(*ppga) * count);
enum cl_req_type crt = (cmd & OBD_BRW_WRITE) ? CRT_WRITE :
CRT_READ;
struct cl_req_attr *crattr = NULL;
- obd_off starting_offset = OBD_OBJECT_EOF;
- obd_off ending_offset = 0;
+ loff_t starting_offset = OBD_OBJECT_EOF;
+ loff_t ending_offset = 0;
int mpflag = 0;
int mem_tight = 0;
int page_count = 0;
list_for_each_entry(oap, &ext->oe_pages, oap_pending_item) {
++page_count;
list_add_tail(&oap->oap_rpc_item, &rpc_list);
- if (starting_offset > oap->oap_obj_off)
+ if (starting_offset == OBD_OBJECT_EOF ||
+ starting_offset > oap->oap_obj_off)
starting_offset = oap->oap_obj_off;
else
LASSERT(oap->oap_page_off == 0);
}
static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
- obd_count keylen, void *key, obd_count vallen,
- void *val, struct ptlrpc_request_set *set)
+ u32 keylen, void *key,
+ u32 vallen, void *val,
+ struct ptlrpc_request_set *set)
{
struct ptlrpc_request *req;
struct obd_device *obd = exp->exp_obd;
struct lu_attr osi_attr;
struct ost_id osi_oi;
struct ost_id osi_oi2;
- obd_id osi_id;
+ u64 osi_id;
loff_t osi_off;
union {
struct llog_rec_hdr osi_hdr;
static inline void osp_objid_buf_prep(struct lu_buf *buf, loff_t *off,
__u32 *id, int index)
{
+ /* Note: through id is only 32 bits, it will also write 64 bits
+ * for oid to keep compatibility with the previous version. */
buf->lb_buf = (void *)id;
- buf->lb_len = sizeof(obd_id);
- *off = sizeof(obd_id) * index;
+ buf->lb_len = sizeof(u64);
+ *off = sizeof(u64) * index;
}
static inline void osp_objseq_buf_prep(struct lu_buf *buf, loff_t *off,
__u64 *seq, int index)
{
buf->lb_buf = (void *)seq;
- buf->lb_len = sizeof(obd_id);
- *off = sizeof(obd_id) * index;
+ buf->lb_len = sizeof(u64);
+ *off = sizeof(u64) * index;
}
static inline void osp_buf_prep(struct lu_buf *lb, void *buf, int buf_len)
void *data, int index, int rc);
/* osp_dev.c */
-void osp_update_last_id(struct osp_device *d, obd_id objid);
+void osp_update_last_id(struct osp_device *d, u64 objid);
extern struct llog_operations osp_mds_ost_orig_logops;
/* osp_trans.c */
int rc;
ENTRY;
- /* Note: through f_oid is only 32bits, it will also write
- * 64 bits for oid to keep compatiblity with the previous
- * version. */
+ /* Note: through f_oid is only 32 bits, it will also write 64 bits
+ * for oid to keep compatibility with the previous version. */
lb_oid->lb_buf = &fid->f_oid;
- lb_oid->lb_len = sizeof(obd_id);
- oid_off = sizeof(obd_id) * osp->opd_index;
+ lb_oid->lb_len = sizeof(u64);
+ oid_off = sizeof(u64) * osp->opd_index;
lb_oseq->lb_buf = &fid->f_seq;
- lb_oseq->lb_len = sizeof(obd_id);
- oseq_off = sizeof(obd_id) * osp->opd_index;
+ lb_oseq->lb_len = sizeof(u64);
+ oseq_off = sizeof(u64) * osp->opd_index;
th = dt_trans_create(env, osp->opd_storage);
if (IS_ERR(th))
void dump_obdo(struct obdo *oa)
{
- __u32 valid = oa->o_valid;
+ u64 valid = oa->o_valid;
- CDEBUG(D_RPCTRACE, "obdo: o_valid = %08x\n", valid);
+ CDEBUG(D_RPCTRACE, "obdo: o_valid = "LPX64"\n", valid);
if (valid & OBD_MD_FLID)
CDEBUG(D_RPCTRACE, "obdo: id = "DOSTID"\n", POSTID(&oa->o_oi));
if (valid & OBD_MD_FLFID)