that is unsigned long too.
- expanding all ->valid fields to 64bit, as it is exhaused and there is no free bits.
static void cmobd_ap_fill_obdo(void *data, int cmd, struct obdo *oa)
{
struct cmobd_async_page *cmap = (struct cmobd_async_page *)data;
- obd_flag valid_flags;
+ obd_valid valid_flags;
struct inode *inode;
ENTRY;
return class_connect(conn, obd, cluuid);
}
-static int cobd_disconnect(struct obd_export *exp, int flags)
+static int cobd_disconnect(struct obd_export *exp, unsigned long flags)
{
- return class_disconnect(exp, 0);
+ return class_disconnect(exp, flags);
}
static int cobd_get_info(struct obd_export *exp, obd_count keylen,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags)
+ obd_flags brw_flags, obd_flags async_flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct obd_export *cobd_exp;
static int cobd_set_async_flags(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
- obd_flag async_flags)
+ obd_flags async_flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct obd_export *cobd_exp;
struct lov_oinfo *loi,
struct obd_io_group *oig,
void *cookie, int cmd, obd_off off,
- int count, obd_flag brw_flags,
- obd_flag async_flags)
+ int count, obd_flags brw_flags,
+ obd_flags async_flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct obd_export *cobd_exp;
}
static int cobd_md_getattr(struct obd_export *exp, struct lustre_id *id,
- unsigned long valid, unsigned int ea_size,
+ __u64 valid, unsigned int ea_size,
struct ptlrpc_request **request)
{
struct obd_device *obd = class_exp2obd(exp);
}
static int cobd_md_getattr_lock(struct obd_export *exp, struct lustre_id *id,
- char *filename, int namelen, unsigned long valid,
+ char *filename, int namelen, __u64 valid,
unsigned int ea_size, struct ptlrpc_request **request)
{
struct obd_device *obd = class_exp2obd(exp);
time_t exp_last_request_time;
spinlock_t exp_lock; /* protects flags int below */
/* ^ protects exp_outstanding_replies too */
- int exp_flags;
+ unsigned long exp_flags;
int exp_failed:1,
exp_replay_needed:1,
exp_libclient:1; /* liblustre client? */
typedef uint32_t obd_mode;
typedef uint32_t obd_uid;
typedef uint32_t obd_gid;
-typedef uint32_t obd_flag;
+typedef uint32_t obd_flags;
+typedef uint64_t obd_valid;
typedef uint32_t obd_count;
-#define OBD_FL_INLINEDATA (0x00000001)
-#define OBD_FL_OBDMDEXISTS (0x00000002)
-#define OBD_FL_DELORPHAN (0x00000004) /* if set in o_flags delete orphans */
-#define OBD_FL_NORPC (0x00000008) // if set in o_flags set in OSC not OST
-#define OBD_FL_IDONLY (0x00000010) // if set in o_flags only adjust obj id
+#define OBD_FL_INLINEDATA (0x00000001)
+#define OBD_FL_OBDMDEXISTS (0x00000002)
+#define OBD_FL_DELORPHAN (0x00000004) /* if set in o_flags delete orphans */
+#define OBD_FL_NORPC (0x00000008) // if set in o_flags set in OSC not OST
+#define OBD_FL_IDONLY (0x00000010) // if set in o_flags only adjust obj id
#define OBD_FL_RECREATE_OBJS (0x00000020) // recreate missing obj
-#define OBD_FL_DEBUG_CHECK (0x00000040) /* echo client/server debug check */
+#define OBD_FL_DEBUG_CHECK (0x00000040) /* echo client/server debug check */
/* this should be sizeof(struct lustre_handle) + sizeof(struct llog_cookie) +
* sizeof(struct lustre_id). */
obd_mode o_mode; /* brw: cli sent cache remain */
obd_uid o_uid;
obd_gid o_gid;
- obd_flag o_flags;
+ obd_flags o_flags;
obd_count o_nlink; /* brw: checksum */
obd_count o_generation;
- obd_flag o_valid; /* hot fields in this obdo */
- obd_count o_misc; /* brw: o_dropped */
+ obd_valid o_valid; /* hot fields in this obdo */
+ obd_count o_misc; /* brw: o_dropped */
__u32 o_easize; /* epoch in ost writes */
__u32 o_mds;
__u64 o_fid;
struct lov_ost_data_v0 lmm_objects[0];
} __attribute__((packed));
-#define OBD_MD_FLALL (0xffffffff)
-#define OBD_MD_FLID (0x00000001) /* object ID */
-#define OBD_MD_FLATIME (0x00000002) /* access time */
-#define OBD_MD_FLMTIME (0x00000004) /* data modification time */
-#define OBD_MD_FLCTIME (0x00000008) /* change time */
-#define OBD_MD_FLSIZE (0x00000010) /* size */
-#define OBD_MD_FLBLOCKS (0x00000020) /* allocated blocks count */
-#define OBD_MD_FLBLKSZ (0x00000040) /* block size */
-#define OBD_MD_FLMODE (0x00000080) /* access bits (mode & ~S_IFMT) */
-#define OBD_MD_FLTYPE (0x00000100) /* object type (mode & S_IFMT) */
-#define OBD_MD_FLUID (0x00000200) /* user ID */
-#define OBD_MD_FLGID (0x00000400) /* group ID */
-#define OBD_MD_FLFLAGS (0x00000800) /* flags word */
-#define OBD_MD_FLNLINK (0x00002000) /* link count */
-#define OBD_MD_FLGENER (0x00004000) /* generation number */
-#define OBD_MD_FLINLINE (0x00008000) /* inline data */
-#define OBD_MD_FLRDEV (0x00010000) /* device number */
-#define OBD_MD_FLEASIZE (0x00020000) /* extended attribute data */
-#define OBD_MD_LINKNAME (0x00040000) /* symbolic link target */
-#define OBD_MD_FLHANDLE (0x00080000) /* file handle */
-#define OBD_MD_FLCKSUM (0x00100000) /* bulk data checksum */
-#define OBD_MD_FLQOS (0x00200000) /* quality of service stats */
-#define OBD_MD_FLOSCOPQ (0x00400000) /* osc opaque data */
-#define OBD_MD_FLCOOKIE (0x00800000) /* log cancellation cookie */
-#define OBD_MD_FLGROUP (0x01000000) /* group */
-#define OBD_MD_FLIFID (0x02000000) /* ->ost write inline fid */
-#define OBD_MD_FLEPOCH (0x04000000) /* ->ost write easize is epoch */
-#define OBD_MD_FLGRANT (0x08000000) /* ost preallocation space grant */
-#define OBD_MD_MDS (0x10000000) /* where an inode lives on */
-#define OBD_MD_FLDIREA (0x20000000) /* dir's extended attribute data */
-#define OBD_MD_REINT (0x40000000) /* reintegrate oa */
-#define OBD_MD_FID (0x80000000) /* take care about fid component */
+#define OBD_MD_FLALL (0xffffffffffffffff)
+#define OBD_MD_FLID (0x0000000000000001) /* object ID */
+#define OBD_MD_FLATIME (0x0000000000000002) /* access time */
+#define OBD_MD_FLMTIME (0x0000000000000004) /* data modification time */
+#define OBD_MD_FLCTIME (0x0000000000000008) /* change time */
+#define OBD_MD_FLSIZE (0x0000000000000010) /* size */
+#define OBD_MD_FLBLOCKS (0x0000000000000020) /* allocated blocks count */
+#define OBD_MD_FLBLKSZ (0x0000000000000040) /* block size */
+#define OBD_MD_FLMODE (0x0000000000000080) /* access bits (mode & ~S_IFMT) */
+#define OBD_MD_FLTYPE (0x0000000000000100) /* object type (mode & S_IFMT) */
+#define OBD_MD_FLUID (0x0000000000000200) /* user ID */
+#define OBD_MD_FLGID (0x0000000000000400) /* group ID */
+#define OBD_MD_FLFLAGS (0x0000000000000800) /* flags word */
+#define OBD_MD_FLNLINK (0x0000000000002000) /* link count */
+#define OBD_MD_FLGENER (0x0000000000004000) /* generation number */
+#define OBD_MD_FLINLINE (0x0000000000008000) /* inline data */
+#define OBD_MD_FLRDEV (0x0000000000010000) /* device number */
+#define OBD_MD_FLEASIZE (0x0000000000020000) /* extended attribute data */
+#define OBD_MD_LINKNAME (0x0000000000040000) /* symbolic link target */
+#define OBD_MD_FLHANDLE (0x0000000000080000) /* file handle */
+#define OBD_MD_FLCKSUM (0x0000000000100000) /* bulk data checksum */
+#define OBD_MD_FLQOS (0x0000000000200000) /* quality of service stats */
+#define OBD_MD_FLOSCOPQ (0x0000000000400000) /* osc opaque data */
+#define OBD_MD_FLCOOKIE (0x0000000000800000) /* log cancellation cookie */
+#define OBD_MD_FLGROUP (0x0000000001000000) /* group */
+#define OBD_MD_FLIFID (0x0000000002000000) /* ->ost write inline fid */
+#define OBD_MD_FLEPOCH (0x0000000004000000) /* ->ost write easize is epoch */
+#define OBD_MD_FLGRANT (0x0000000008000000) /* ost preallocation space grant */
+#define OBD_MD_MDS (0x0000000010000000) /* where an inode lives on */
+#define OBD_MD_FLDIREA (0x0000000020000000) /* dir's extended attribute data */
+#define OBD_MD_REINT (0x0000000040000000) /* reintegrate oa */
+#define OBD_MD_FID (0x0000000080000000) /* take care about fid component */
+
#define OBD_MD_FLNOTOBD (~(OBD_MD_FLBLOCKS | OBD_MD_LINKNAME | \
- OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | OBD_MD_FLCKSUM | \
- OBD_MD_FLQOS | OBD_MD_FLOSCOPQ | OBD_MD_FLCOOKIE| \
+ OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | \
+ OBD_MD_FLCKSUM | OBD_MD_FLQOS | \
+ OBD_MD_FLOSCOPQ | OBD_MD_FLCOOKIE | \
OBD_MD_MDS))
static inline struct lustre_handle *obdo_handle(struct obdo *oa)
__u64 size; /* Offset, in the case of MDS_READPAGE */
__u64 blocks; /* XID, in the case of MDS_READPAGE */
__u64 io_epoch;
- __u32 valid;
+ __u64 valid;
__u32 mode;
__u32 uid;
__u32 gid;
struct mdc_op_data {
struct lustre_id id1;
struct lustre_id id2;
- __u64 mod_time;
- const char *name;
- int namelen;
- __u32 create_mode;
- struct mea *mea1; /* mea of inode1 */
- struct mea *mea2; /* mea of inode2 */
- __u32 valid;
+ __u64 mod_time;
+ const char *name;
+ int namelen;
+ __u32 create_mode;
+ struct mea *mea1; /* mea of inode1 */
+ struct mea *mea2; /* mea of inode2 */
+ __u64 valid;
};
#define MDS_MODE_DONT_LOCK (1 << 30)
struct lustre_md *md);
int mdc_getstatus(struct obd_export *exp, struct lustre_id *rootid);
int mdc_getattr(struct obd_export *exp, struct lustre_id *id,
- unsigned long valid, unsigned int ea_size,
+ __u64 valid, unsigned int ea_size,
struct ptlrpc_request **request);
int mdc_getattr_lock(struct obd_export *exp, struct lustre_id *id,
- char *filename, int namelen, unsigned long valid,
+ char *filename, int namelen, __u64 valid,
unsigned int ea_size, struct ptlrpc_request **request);
int mdc_setattr(struct obd_export *exp, struct mdc_op_data *data,
struct iattr *iattr, void *ea, int ealen, void *ea2, int ea2len,
int client_obd_cleanup(struct obd_device * obddev, int flags);
int client_connect_import(struct lustre_handle *conn, struct obd_device *obd,
struct obd_uuid *cluuid, unsigned long);
-int client_disconnect_export(struct obd_export *exp, int failover);
+int client_disconnect_export(struct obd_export *exp, unsigned long);
int client_import_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
int priority);
obd_off page_offset; /* modulo PAGE_SIZE (obviously) */
struct page *pg;
int count;
- obd_flag flag;
+ obd_flags flag;
};
enum async_flags {
int priority);
int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid);
int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
- struct obd_uuid *cluuid, unsigned long connect_flags);
- int (*o_connect_post)(struct obd_export *exp, unsigned long connect_flags);
- int (*o_disconnect)(struct obd_export *exp, int flags);
+ struct obd_uuid *cluuid, unsigned long flags);
+ int (*o_connect_post)(struct obd_export *exp, unsigned long flags);
+ int (*o_disconnect)(struct obd_export *exp, unsigned long flags);
int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs,
unsigned long max_age);
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags);
+ obd_flags brw_flags, obd_flags async_flags);
int (*o_queue_group_io)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi,
struct obd_io_group *oig,
void *cookie, int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags);
+ obd_flags brw_flags, obd_flags async_flags);
int (*o_trigger_group_io)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi,
int (*o_set_async_flags)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
- obd_flag async_flags);
+ obd_flags async_flags);
int (*o_teardown_async_page)(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie);
void *, int, ldlm_completion_callback,
ldlm_blocking_callback, void *);
int (*m_getattr)(struct obd_export *, struct lustre_id *,
- unsigned long, unsigned int,
+ __u64, unsigned int,
struct ptlrpc_request **);
int (*m_getattr_lock)(struct obd_export *, struct lustre_id *,
- char *, int, unsigned long,
+ char *, int, __u64,
unsigned int, struct ptlrpc_request **);
int (*m_intent_lock)(struct obd_export *,
struct lustre_id *, const char *, int,
void class_put_type(struct obd_type *type);
int class_connect(struct lustre_handle *conn, struct obd_device *obd,
struct obd_uuid *cluuid);
-int class_disconnect(struct obd_export *exp, int flags);
-void class_disconnect_exports(struct obd_device *obddev, int flags);
-void class_disconnect_stale_exports(struct obd_device *obddev, int flags);
+int class_disconnect(struct obd_export *exp, unsigned long flags);
+void class_disconnect_exports(struct obd_device *obddev, unsigned long flags);
+void class_disconnect_stale_exports(struct obd_device *obddev, unsigned long flags);
/* generic operations shared by various OBD types */
int class_multi_setup(struct obd_device *obddev, uint32_t len, void *data);
/* obdo.c */
#ifdef __KERNEL__
void obdo_from_iattr(struct obdo *oa, struct iattr *attr, unsigned ia_valid);
-void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid);
-void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid);
-void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid);
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
+void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_valid valid);
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_valid valid);
+void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_valid valid);
+void obdo_to_inode(struct inode *dst, struct obdo *src, obd_valid valid);
#endif
-void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid);
-int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_flag compare);
+void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_valid valid);
+int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_valid compare);
void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj);
static inline int obd_check_conn(struct lustre_handle *conn)
RETURN(rc);
}
-static inline int obd_disconnect(struct obd_export *exp, int flags)
+static inline int obd_disconnect(struct obd_export *exp, unsigned long flags)
{
int rc;
ENTRY;
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags)
+ obd_flags brw_flags, obd_flags async_flags)
{
int rc;
ENTRY;
static inline int obd_set_async_flags(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
- obd_flag async_flags)
+ obd_flags async_flags)
{
int rc;
ENTRY;
struct lov_oinfo *loi,
struct obd_io_group *oig,
void *cookie, int cmd, obd_off off,
- int count, obd_flag brw_flags,
- obd_flag async_flags)
+ int count, obd_flags brw_flags,
+ obd_flags async_flags)
{
int rc;
ENTRY;
}
static inline int md_getattr(struct obd_export *exp, struct lustre_id *id,
- unsigned long valid, unsigned int ea_size,
+ __u64 valid, unsigned int ea_size,
struct ptlrpc_request **request)
{
int rc;
static inline int md_getattr_lock(struct obd_export *exp, struct lustre_id *id,
char *filename, int namelen,
- unsigned long valid, unsigned int ea_size,
+ __u64 valid, unsigned int ea_size,
struct ptlrpc_request **request)
{
int rc;
return rc;
}
-int client_disconnect_export(struct obd_export *exp, int flags)
+int client_disconnect_export(struct obd_export *exp, unsigned long flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct client_obd *cli = &obd->u.cli;
void obdo_refresh_inode(struct inode *dst,
struct obdo *src,
- obd_flag valid)
+ obd_valid valid)
{
struct llu_inode_info *lli = llu_i2info(dst);
valid &= src->o_valid;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
+ CDEBUG(D_INODE, "valid "LPX64", cur time %lu/%lu, new %lu/%lu\n",
src->o_valid, LTIME_S(lli->lli_st_mtime),
LTIME_S(lli->lli_st_ctime),
(long)src->o_mtime, (long)src->o_ctime);
/* super.c */
void llu_update_inode(struct inode *inode, struct mds_body *body,
struct lov_stripe_md *lmm);
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
-void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid);
+void obdo_to_inode(struct inode *dst, struct obdo *src, obd_valid valid);
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_valid valid);
int ll_it_open_error(int phase, struct lookup_intent *it);
struct inode *llu_iget(struct filesys *fs, struct lustre_md *md);
int llu_inode_getattr(struct inode *inode, struct lov_stripe_md *lsm);
int llu_iop_close(struct inode *inode);
_SYSIO_OFF_T llu_iop_pos(struct inode *ino, _SYSIO_OFF_T off);
int llu_vmtruncate(struct inode * inode, loff_t offset);
-void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid);
+void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_valid valid);
int llu_objects_destroy(struct ptlrpc_request *request, struct inode *dir);
/* rw.c */
struct ll_async_page *llap;
struct inode *inode;
struct lov_stripe_md *lsm;
- obd_flag valid_flags;
+ obd_valid valid_flags;
ENTRY;
llap = llap_from_cookie(data);
lli->lli_st_blocks = body->blocks;
}
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
+void obdo_to_inode(struct inode *dst, struct obdo *src, obd_valid valid)
{
struct llu_inode_info *lli = llu_i2info(dst);
#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
-void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid)
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_valid valid)
{
struct llu_inode_info *lli = llu_i2info(src);
- obd_flag newvalid = 0;
+ obd_valid newvalid = 0;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n",
struct obd_export *exp = llu_i2obdexp(inode);
struct ptlrpc_request_set *set;
struct obdo oa;
- obd_flag refresh_valid;
+ obd_valid refresh_valid;
int rc;
ENTRY;
struct ptlrpc_request *req = NULL;
struct llu_sb_info *sbi = llu_i2sbi(inode);
struct lustre_id id;
- unsigned long valid = 0;
+ __u64 valid = 0;
int rc, ealen = 0;
/* Why don't we update all valid MDS fields here, if we're doing
char *buf = NULL;
char *filename;
int namelen, rc, len = 0;
- unsigned long valid;
+ __u64 valid;
rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
if (rc)
struct lov_mds_md *lmm;
struct lustre_id id;
struct mds_body *body;
- unsigned long valid = 0;
+ __u64 valid = 0;
int rc, lmmsize;
valid |= OBD_MD_FLDIREA;
ldlm_policy_data_t policy = { .l_extent = {0, OBD_OBJECT_EOF } };
struct lustre_handle lockh = { 0 };
struct obdo obdo;
- obd_flag valid;
+ obd_valid valid;
int rc, ast_flags = 0;
ENTRY;
switch(cmd) {
case EXT3_IOC_GETFLAGS: {
struct lustre_id id;
- unsigned long valid = OBD_MD_FLFLAGS;
+ __u64 valid = OBD_MD_FLFLAGS;
struct mds_body *body;
ll_inode2id(&id, inode);
{
struct ptlrpc_request *request = NULL;
struct mds_body *body;
- int valid = 0;
+ __u64 valid = 0;
int rc;
valid |= OBD_MD_FID;
return (key0 << 1);
}
-static struct inode * search_inode_for_lustre(struct super_block *sb,
- unsigned long ino,
- unsigned long generation,
- int mode)
+static struct inode *search_inode_for_lustre(struct super_block *sb,
+ unsigned long ino,
+ unsigned long generation,
+ int mode)
{
struct ptlrpc_request *req = NULL;
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct lustre_id id;
- unsigned long valid = 0;
+ __u64 valid = 0;
int eadatalen = 0, rc;
struct inode *inode = NULL;
eadatalen = obd_size_diskmd(sbi->ll_lov_exp, NULL);
valid |= OBD_MD_FLEASIZE;
}
- id.li_stc.u.e3s.l3s_type = mode;
- id.li_stc.u.e3s.l3s_ino = (__u64)ino;
- id.li_stc.u.e3s.l3s_gen = generation;
+ id_type(&id) = mode;
+ id_ino(&id) = (__u64)ino;
+ id_gen(&id) = generation;
rc = md_getattr(sbi->ll_lmv_exp, &id, valid, eadatalen, &req);
if (rc) {
void ll_inode_fill_obdo(struct inode *inode, int cmd, struct obdo *oa)
{
struct lov_stripe_md *lsm;
- obd_flag valid_flags;
+ obd_valid valid_flags;
lsm = ll_i2info(inode)->lli_smd;
struct lov_stripe_md *lsm,
struct ll_async_page *llap,
unsigned to,
- obd_flag async_flags)
+ obd_flags async_flags)
{
struct obd_io_group *oig;
int rc;
tgt_obd = class_find_client_obd(&tgts->uuid, LUSTRE_MDC_NAME,
&obd->obd_uuid);
if (!tgt_obd) {
- CERROR("Target %s not attached\n", tgts->uuid.uuid);
+ CERROR("target %s not attached\n", tgts->uuid.uuid);
GOTO(out_disc, rc = -EINVAL);
}
cluuid->uuid);
if (!tgt_obd->obd_set_up) {
- CERROR("Target %s not set up\n", tgts->uuid.uuid);
+ CERROR("target %s not set up\n", tgts->uuid.uuid);
GOTO(out_disc, rc = -EINVAL);
}
rc = obd_connect(&conn, tgt_obd, &lmv_mdc_uuid,
lmv->connect_flags);
if (rc) {
- CERROR("Target %s connect error %d\n",
+ CERROR("target %s connect error %d\n",
tgts->uuid.uuid, rc);
GOTO(out_disc, rc);
}
rc = obd_register_observer(tgt_obd, obd);
if (rc) {
- CERROR("Target %s register_observer error %d\n",
+ CERROR("target %s register_observer error %d\n",
tgts->uuid.uuid, rc);
obd_disconnect(tgts->ltd_exp, 0);
GOTO(out_disc, rc);
RETURN (rc);
}
-static int lmv_disconnect(struct obd_export *exp, int flags)
+static int lmv_disconnect(struct obd_export *exp, unsigned long flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct lmv_obd *lmv = &obd->u.lmv;
}
static int lmv_getattr(struct obd_export *exp, struct lustre_id *id,
- unsigned long valid, unsigned int ea_size,
+ __u64 valid, unsigned int ea_size,
struct ptlrpc_request **request)
{
struct obd_device *obd = exp->exp_obd;
struct ptlrpc_request *req = NULL;
struct lmv_obj *obj;
struct lustre_md md;
- unsigned long valid;
+ __u64 valid;
int mealen, rc;
md.mea = NULL;
}
int lmv_getattr_lock(struct obd_export *exp, struct lustre_id *id,
- char *filename, int namelen, unsigned long valid,
+ char *filename, int namelen, __u64 valid,
unsigned int ea_size, struct ptlrpc_request **request)
{
int rc, mds = id_group(id), loop = 0;
struct lustre_id rid = *id;
struct mds_body *body;
struct lmv_obj *obj;
- int old_valid;
+ __u64 old_valid;
ENTRY;
rc = lmv_check_connect(obd);
struct lmv_obd *lmv = &obd->u.lmv;
struct mea *mea = data->mea1;
struct mdc_op_data data2;
- int i, rc = 0, mds;
+ int i, rc = 0;
ENTRY;
LASSERT(mea != NULL);
data2.id1 = mea->mea_ids[i];
data2.create_mode = MDS_MODE_DONT_LOCK | S_IFDIR;
- mds = id_group(&data2.id1);
-
- if (lmv->tgts[mds].ltd_exp == NULL)
+ if (lmv->tgts[id_group(&data2.id1)].ltd_exp == NULL)
continue;
- rc = md_unlink(lmv->tgts[mds].ltd_exp, &data2, req);
+ rc = md_unlink(lmv->tgts[id_group(&data2.id1)].ltd_exp,
+ &data2, req);
+
CDEBUG(D_OTHER, "unlink slave "DLID4" -> %d\n",
OLID4(&mea->mea_ids[i]), rc);
+
if (*req) {
ptlrpc_req_finished(*req);
*req = NULL;
}
if (rc)
- break;
+ RETURN(rc);
}
RETURN(rc);
}
int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id)
{
+ LASSERT(exp && id);
+
ENTRY;
- lmv_delete_obj(exp, id);
+ if (lmv_delete_obj(exp, id)) {
+ CDEBUG(D_OTHER, "lmv object "DLID4" is destroyed.\n",
+ OLID4(id));
+ }
RETURN(0);
}
OLID4(&data->id1));
}
rc = md_unlink(lmv->tgts[id_group(&data->id1)].ltd_exp,
- data, request);
+ data, request);
RETURN(rc);
}
OLID4(id));
if (!mea) {
- unsigned long valid;
+ __u64 valid;
CDEBUG(D_OTHER, "mea isn't passed in, get it now\n");
mealen = MEA_SIZE_LMV(lmv);
RETURN (rc);
}
-static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
- int flags)
+static int lov_disconnect_obd(struct obd_device *obd,
+ struct lov_tgt_desc *tgt,
+ unsigned long flags)
{
#ifdef __KERNEL__
struct proc_dir_entry *lov_proc_dir;
RETURN(0);
}
-static int lov_disconnect(struct obd_export *exp, int flags)
+static int lov_disconnect(struct obd_export *exp, unsigned long flags)
{
struct obd_device *obd = class_exp2obd(exp);
#ifdef __KERNEL__
return lov_size;
}
-static void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_flag valid,
+static void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_valid valid,
struct lov_stripe_md *lsm, int stripeno, int *set)
{
valid &= src->o_valid;
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags)
+ obd_flags brw_flags, obd_flags async_flags)
{
struct lov_obd *lov = &exp->exp_obd->u.lov;
struct lov_async_page *lap;
static int lov_set_async_flags(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
- obd_flag async_flags)
+ obd_flags async_flags)
{
struct lov_obd *lov = &exp->exp_obd->u.lov;
struct lov_async_page *lap;
struct lov_oinfo *loi,
struct obd_io_group *oig, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, obd_flag async_flags)
+ obd_flags brw_flags, obd_flags async_flags)
{
struct lov_obd *lov = &exp->exp_obd->u.lov;
struct lov_async_page *lap;
#define MDC_INTERNAL_H
void mdc_getattr_pack(struct lustre_msg *msg, int offset,
- int valid, int flags, struct mdc_op_data *data);
+ __u64 valid, int flags, struct mdc_op_data *data);
void mdc_open_pack(struct lustre_msg *msg, int offset,
struct mdc_op_data *op_data, __u32 mode, __u64 rdev,
__u32 flags, const void *lmm, int lmmlen);
void mdc_readdir_pack(struct ptlrpc_request *req, int req_offset,
__u64 offset, __u32 size, struct lustre_id *mdc_id);
void mdc_close_pack(struct ptlrpc_request *req, int offset, struct obdo *oa,
- int valid, struct obd_client_handle *och);
+ __u64 valid, struct obd_client_handle *och);
struct mdc_open_data {
struct obd_client_handle *mod_och;
}
}
-void mdc_getattr_pack(struct lustre_msg *msg, int offset, int valid,
- int flags, struct mdc_op_data *data)
+void mdc_getattr_pack(struct lustre_msg *msg, int offset,
+ __u64 valid, int flags, struct mdc_op_data *data)
{
struct mds_body *b;
b = lustre_msg_buf(msg, offset, sizeof (*b));
}
void mdc_close_pack(struct ptlrpc_request *req, int offset, struct obdo *oa,
- int valid, struct obd_client_handle *och)
+ __u64 valid, struct obd_client_handle *och)
{
struct mds_body *body;
reply_buffers = 3;
req->rq_replen = lustre_msg_size(3, repsize);
} else if (it->it_op & (IT_GETATTR | IT_LOOKUP | IT_CHDIR)) {
- int valid = data->valid | OBD_MD_FLNOTOBD | OBD_MD_FLEASIZE;
+ __u64 valid = data->valid | OBD_MD_FLNOTOBD | OBD_MD_FLEASIZE;
reqsize[req_buffers++] = sizeof(struct mds_body);
reqsize[req_buffers++] = data->namelen + 1;
}
int mdc_getattr(struct obd_export *exp, struct lustre_id *id,
- unsigned long valid, unsigned int ea_size,
+ __u64 valid, unsigned int ea_size,
struct ptlrpc_request **request)
{
struct ptlrpc_request *req;
}
int mdc_getattr_lock(struct obd_export *exp, struct lustre_id *id,
- char *filename, int namelen, unsigned long valid,
+ char *filename, int namelen, __u64 valid,
unsigned int ea_size, struct ptlrpc_request **request)
{
struct ptlrpc_request *req;
return rc;
}
-static int mds_disconnect(struct obd_export *exp, int flags)
+static int mds_disconnect(struct obd_export *exp, unsigned long flags)
{
unsigned long irqflags;
struct obd_device *obd;
if (dentry->d_flags & DCACHE_CROSS_REF) {
mds_pack_dentry2body(obd, body, dentry,
- (reqbody->valid & OBD_MD_FID));
+ (reqbody->valid & OBD_MD_FID) ? 1 : 0);
CDEBUG(D_OTHER, "cross reference: "DLID4"\n",
OLID4(&body->id1));
RETURN(0);
}
- mds_pack_inode2body(obd, body, inode, (reqbody->valid & OBD_MD_FID));
+ mds_pack_inode2body(obd, body, inode,
+ (reqbody->valid & OBD_MD_FID) ? 1 : 0);
if ((S_ISREG(inode->i_mode) && (reqbody->valid & OBD_MD_FLEASIZE)) ||
(S_ISDIR(inode->i_mode) && (reqbody->valid & OBD_MD_FLDIREA))) {
return rc;
}
-static int mds_getattr_pack_msg(struct ptlrpc_request *req, struct inode *inode,
+static int mds_getattr_pack_msg(struct ptlrpc_request *req,
+ struct inode *inode,
int offset)
{
struct mds_obd *mds = mds_req2mds(req);
GOTO(cleanup, rc);
if (!(body->valid & OBD_MD_FLEASIZE)) {
- body->valid |=(OBD_MD_FLSIZE | OBD_MD_FLBLOCKS |
- OBD_MD_FLATIME | OBD_MD_FLMTIME);
+ body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS |
+ OBD_MD_FLATIME | OBD_MD_FLMTIME);
} else if (mds_log_op_unlink(obd, child_inode,
lustre_msg_buf(req->rq_repmsg, offset + 1, 0),
req->rq_repmsg->buflens[offset + 1],
int dump_obdo(struct obdo *oa)
{
- __u32 valid = oa->o_valid;
+ __u64 valid = oa->o_valid;
- CERROR("obdo: o_valid = %08x\n", valid);
+ CERROR("obdo: o_valid = "LPX64"\n", valid);
if (valid & OBD_MD_FLID)
CERROR("obdo: o_id = "LPD64"\n", oa->o_id);
if (valid & OBD_MD_FLATIME)
if (valid & OBD_MD_FLGID)
CERROR("obdo: o_gid = %u\n", oa->o_gid);
if (valid & OBD_MD_FLFLAGS)
- CERROR("obdo: o_flags = %x\n", oa->o_flags);
+ CERROR("obdo: o_flags = 0x%x\n", oa->o_flags);
if (valid & OBD_MD_FLNLINK)
CERROR("obdo: o_nlink = %u\n", oa->o_nlink);
if (valid & OBD_MD_FLGENER)
* hash entry and one for the export pointer passed in. The export
* pointer passed to this function is destroyed should not be used
* again. */
-int class_disconnect(struct obd_export *export, int flags)
+int class_disconnect(struct obd_export *export, unsigned long flags)
{
ENTRY;
RETURN(0);
}
-static void class_disconnect_export_list(struct list_head *list, int flags)
+static void class_disconnect_export_list(struct list_head *list, unsigned long flags)
{
struct obd_export *fake_exp, *exp;
struct lustre_handle fake_conn;
EXIT;
}
-void class_disconnect_exports(struct obd_device *obd, int flags)
+void class_disconnect_exports(struct obd_device *obd, unsigned long flags)
{
struct list_head work_list;
ENTRY;
/* Remove exports that have not completed recovery.
*/
-void class_disconnect_stale_exports(struct obd_device *obd, int flags)
+void class_disconnect_stale_exports(struct obd_device *obd, unsigned long flags)
{
struct list_head work_list;
struct list_head *pos, *n;
}
EXPORT_SYMBOL(obdo_from_iattr);
-void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid)
+void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_valid valid)
{
valid &= oa->o_valid;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n",
+ CDEBUG(D_INODE, "valid "LPX64", new time %lu/%lu\n",
oa->o_valid, (long)oa->o_mtime, (long)oa->o_ctime);
attr->ia_valid = 0;
/* 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, obd_flag valid)
+void obdo_from_inode(struct obdo *dst, struct inode *src, obd_valid valid)
{
- obd_flag newvalid = 0;
+ obd_valid 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));
+ 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_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid)
+void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_valid valid)
{
valid &= src->o_valid;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
+ CDEBUG(D_INODE, "valid "LPX64", cur time %lu/%lu, new %lu/%lu\n",
src->o_valid, LTIME_S(dst->i_mtime),
LTIME_S(dst->i_ctime),
(long)src->o_mtime, (long)src->o_ctime);
}
EXPORT_SYMBOL(obdo_refresh_inode);
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
+void obdo_to_inode(struct inode *dst, struct obdo *src, obd_valid valid)
{
valid &= src->o_valid;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
+ CDEBUG(D_INODE, "valid "LPX64", cur time %lu/%lu, new %lu/%lu\n",
src->o_valid,
LTIME_S(dst->i_mtime), LTIME_S(dst->i_ctime),
(long)src->o_mtime, (long)src->o_ctime);
EXPORT_SYMBOL(obdo_to_inode);
#endif
-void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid)
+void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_valid valid)
{
#ifdef __KERNEL__
- CDEBUG(D_INODE, "src obdo "LPX64" valid 0x%x, dst obdo "LPX64"\n",
+ CDEBUG(D_INODE, "src obdo "LPX64" valid "LPX64", dst obdo "LPX64"\n",
src->o_id, src->o_valid, dst->o_id);
#endif
if (valid & OBD_MD_FLATIME)
EXPORT_SYMBOL(obdo_cpy_md);
/* returns FALSE if comparison (by flags) is same, TRUE if changed */
-int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_flag compare)
+int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_valid compare)
{
int res = 0;
return class_connect(conn, obd, cluuid);
}
-static int echo_disconnect(struct obd_export *exp, int flags)
+static int echo_disconnect(struct obd_export *exp, unsigned long flags)
{
unsigned long irqflags;
}
if (!(oa->o_valid & OBD_MD_FLTYPE)) {
- CERROR("invalid o_valid %08x\n", oa->o_valid);
+ CERROR("invalid o_valid "LPX64"\n", oa->o_valid);
return -EINVAL;
}
}
if (!(oa->o_valid & OBD_MD_FLID)) {
- CERROR("obdo missing FLID valid flag: %08x\n", oa->o_valid);
+ CERROR("obdo missing FLID valid flag: "LPX64"\n", oa->o_valid);
RETURN(-EINVAL);
}
}
if (!(oa->o_valid & OBD_MD_FLID)) {
- CERROR("obdo missing FLID valid flag: %08x\n", oa->o_valid);
+ CERROR("obdo missing FLID valid flag: "LPX64"\n", oa->o_valid);
RETURN(-EINVAL);
}
}
if (!(oa->o_valid & OBD_MD_FLID)) {
- CERROR("obdo missing FLID valid flag: %08x\n", oa->o_valid);
+ CERROR("obdo missing FLID valid flag: "LPX64"\n", oa->o_valid);
RETURN(-EINVAL);
}
}
static int echo_client_connect(struct lustre_handle *conn,
- struct obd_device *src, struct obd_uuid *cluuid,
- unsigned long connect_flags)
+ struct obd_device *src,
+ struct obd_uuid *cluuid,
+ unsigned long flags)
{
struct obd_export *exp;
int rc;
RETURN (rc);
}
-static int echo_client_disconnect(struct obd_export *exp, int flags)
+static int echo_client_disconnect(struct obd_export *exp,
+ unsigned long flags)
{
struct obd_device *obd;
struct echo_client_obd *ec;
}
/* also incredibly similar to mds_disconnect */
-static int filter_disconnect(struct obd_export *exp, int flags)
+static int filter_disconnect(struct obd_export *exp, unsigned long flags)
{
struct obd_device *obd = exp->exp_obd;
unsigned long irqflags;
CERROR("PUNCH not supported, only truncate: end = "LPX64"\n",
end);
- CDEBUG(D_INODE, "calling truncate for object "LPU64", valid = %x, "
+ CDEBUG(D_INODE, "calling truncate for object "LPU64", valid = "LPU64", "
"o_size = "LPD64"\n", oa->o_id, oa->o_valid, start);
oa->o_size = start;
error = filter_setattr(exp, oa, NULL, oti);
obd_off oap_obj_off;
obd_off oap_page_off;
int oap_count;
- obd_flag oap_brw_flags;
+ obd_flags oap_brw_flags;
enum async_flags oap_async_flags;
unsigned long oap_interrupted:1;
static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,
long writing_bytes)
{
- obd_flag bits = OBD_MD_FLBLOCKS|OBD_MD_FLGRANT;
+ obd_valid bits = OBD_MD_FLBLOCKS|OBD_MD_FLGRANT;
LASSERT(!(oa->o_valid & bits));
static int osc_queue_async_io(struct obd_export *exp, struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags, enum async_flags async_flags)
+ obd_flags brw_flags, enum async_flags async_flags)
{
struct client_obd *cli = &exp->exp_obd->u.cli;
struct osc_async_page *oap;
static int osc_set_async_flags(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi, void *cookie,
- obd_flag async_flags)
+ obd_flags async_flags)
{
struct client_obd *cli = &exp->exp_obd->u.cli;
struct loi_oap_pages *lop;
struct lov_oinfo *loi,
struct obd_io_group *oig, void *cookie,
int cmd, obd_off off, int count,
- obd_flag brw_flags,
- obd_flag async_flags)
+ obd_flags brw_flags,
+ obd_flags async_flags)
{
struct client_obd *cli = &exp->exp_obd->u.cli;
struct osc_async_page *oap;
RETURN(rc);
}
-static int osc_disconnect(struct obd_export *exp, int flags)
+static int osc_disconnect(struct obd_export *exp, unsigned long flags)
{
struct obd_device *obd = class_exp2obd(exp);
struct llog_ctxt *ctxt;
/* modelled after ptlrpc_import_disconnect() */
-int ptlbd_cl_disconnect(struct obd_export *exp, int failover)
+int ptlbd_cl_disconnect(struct obd_export *exp, unsigned long flags)
{
struct obd_device *obd = exp->exp_obd;
struct ptlbd_obd *ptlbd = &obd->u.ptlbd;
if (!obd)
RETURN(-EINVAL);
- request = ptlrpc_prep_req(imp, LUSTRE_PBD_VERSION, PTLBD_DISCONNECT,
+ request = ptlrpc_prep_req(imp, LUSTRE_PBD_VERSION,
+ PTLBD_DISCONNECT,
0, NULL, NULL);
if (!request)
GOTO(out_req, rc = -ENOMEM);
__swab32s (&o->o_flags);
__swab32s (&o->o_nlink);
__swab32s (&o->o_generation);
- __swab32s (&o->o_valid);
+ __swab64s (&o->o_valid);
__swab32s (&o->o_misc);
__swab32s (&o->o_easize);
__swab32s (&o->o_mds);
/* handle is opaque */
__swab64s (&b->size);
__swab64s (&b->blocks);
- __swab32s (&b->valid);
+ __swab64s (&b->valid);
__swab32s (&b->mode);
__swab32s (&b->uid);
__swab32s (&b->gid);
#define FILTER_DID_JOURNAL_OPS 0x100
struct filter_fs {
- int o_flags;
+ unsigned long o_flags;
struct filter_ops o_fops;
struct cache_ops o_caops;
struct journal_ops *o_trops;
sprintf(buf, "id: "LPX64"\ngrp: "LPX64"\natime: "LPU64"\nmtime: "LPU64
"\nctime: "LPU64"\nsize: "LPU64"\nblocks: "LPU64
"\nblksize: %u\nmode: %o\nuid: %d\ngid: %d\nflags: %x\n"
- "misc: %x\nnlink: %d,\nvalid %x\n",
+ "misc: %x\nnlink: %d,\nvalid "LPX64"\n",
obd->o_id, obd->o_gr, obd->o_atime, obd->o_mtime, obd->o_ctime,
obd->o_size, obd->o_blocks, obd->o_blksize, obd->o_mode,
obd->o_uid, obd->o_gid, obd->o_flags, obd->o_misc,
break;
}
if (!(data.ioc_obdo1.o_valid & OBD_MD_FLID)) {
- fprintf(stderr, "error: %s: objid not valid #%d:%08x\n",
+ fprintf(stderr, "error: %s: objid not valid #%d:"LPX64"\n",
jt_cmdname(argv[0]), i, data.ioc_obdo1.o_valid);
rc = EINVAL;
break;
for (i = 1, next_count = verbose; i <= count; i++) {
data.ioc_obdo1.o_id = objid;
data.ioc_obdo1.o_mode = S_IFREG;
- data.ioc_obdo1.o_valid = 0xffffffff;
+ data.ioc_obdo1.o_valid = 0xffffffffffffffff;
IOC_PACK(argv[0], data);
rc = l2_ioctl(OBD_DEV_ID, OBD_IOC_GETATTR, &data);
shmem_bump();