From a6f415ad648f2da0708612beba51f34c2594f5ec Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Fri, 19 Dec 2014 17:37:39 +0300 Subject: [PATCH] LU-5478 osd: get rid of obd_* typedefs We have a bunch of typedefs for common things that made no sense and hid the actual type from plain view. Replace them with proper uXX or sXX types. Exception is in lustre_idl.h and lustre_ioctl.h where they are replaced with __uXX and __sXX to be able to be included in userspace patch 7 in series: modify osd-ldiskfs/osd-zfs Signed-off-by: Oleg Drokin Signed-off-by: Dmitry Eremin Change-Id: I9809d57ae8665fb7a932645cc2258d3adc1a0ff1 Reviewed-on: http://review.whamcloud.com/13149 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: James Simmons --- lustre/osd-ldiskfs/osd_compat.c | 13 ++++++------- lustre/osd-ldiskfs/osd_handler.c | 4 ++-- lustre/osd-ldiskfs/osd_internal.h | 6 +++--- lustre/osd-ldiskfs/osd_io.c | 2 +- lustre/osd-ldiskfs/osd_quota_fmt.h | 4 ++-- lustre/osd-zfs/osd_handler.c | 2 +- lustre/osd-zfs/osd_index.c | 2 +- lustre/osd-zfs/osd_internal.h | 4 ++-- lustre/osd-zfs/osd_oi.c | 11 +++++------ 9 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lustre/osd-ldiskfs/osd_compat.c b/lustre/osd-ldiskfs/osd_compat.c index 0a34228..fa43e2b 100644 --- a/lustre/osd-ldiskfs/osd_compat.c +++ b/lustre/osd-ldiskfs/osd_compat.c @@ -480,8 +480,7 @@ int osd_obj_map_init(const struct lu_env *env, struct osd_device *dev) RETURN(rc); } -static struct osd_obj_seq *osd_seq_find_locked(struct osd_obj_map *map, - obd_seq seq) +static struct osd_obj_seq *osd_seq_find_locked(struct osd_obj_map *map, u64 seq) { struct osd_obj_seq *osd_seq; @@ -492,7 +491,7 @@ static struct osd_obj_seq *osd_seq_find_locked(struct osd_obj_map *map, return NULL; } -static struct osd_obj_seq *osd_seq_find(struct osd_obj_map *map, obd_seq seq) +static struct osd_obj_seq *osd_seq_find(struct osd_obj_map *map, u64 seq) { struct osd_obj_seq *osd_seq; @@ -695,7 +694,7 @@ static int osd_obj_add_entry(struct osd_thread_info *info, * debug messages to objects in the future, and the legacy space * of FID_SEQ_OST_MDT0 will be unused in the future. **/ -static inline void osd_seq_name(char *seq_name, size_t name_size, obd_seq seq) +static inline void osd_seq_name(char *seq_name, size_t name_size, u64 seq) { snprintf(seq_name, name_size, (fid_seq_is_rsvd(seq) || @@ -704,7 +703,7 @@ static inline void osd_seq_name(char *seq_name, size_t name_size, obd_seq seq) } static inline void osd_oid_name(char *name, size_t name_size, - const struct lu_fid *fid, obd_id id) + const struct lu_fid *fid, u64 id) { snprintf(name, name_size, (fid_seq_is_rsvd(fid_seq(fid)) || @@ -799,7 +798,7 @@ out_err: } static struct osd_obj_seq *osd_seq_load(struct osd_thread_info *info, - struct osd_device *osd, obd_seq seq) + struct osd_device *osd, u64 seq) { struct osd_obj_map *map; struct osd_obj_seq *osd_seq; @@ -923,7 +922,7 @@ int osd_obj_map_insert(struct osd_thread_info *info, struct osd_obj_seq *osd_seq; struct dentry *d; struct ost_id *ostid = &info->oti_ostid; - obd_id oid; + u64 oid; int dirn, rc = 0; char name[32]; ENTRY; diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index af1eb5d..588d233 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -1074,7 +1074,7 @@ out: } static int osd_seq_exists(const struct lu_env *env, - struct osd_device *osd, obd_seq seq) + struct osd_device *osd, u64 seq) { struct lu_seq_range *range = &osd_oti_get(env)->oti_seq_range; struct seq_server_site *ss = osd_seq_site(osd); @@ -2332,7 +2332,7 @@ static int __osd_oi_insert(const struct lu_env *env, struct osd_object *obj, } int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd, - obd_seq seq, struct lu_seq_range *range) + u64 seq, struct lu_seq_range *range) { struct seq_server_site *ss = osd_seq_site(osd); diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index ed3571f..cea4cc6 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -145,7 +145,7 @@ struct osd_obj_seq { int oos_subdir_count; /* subdir count for each seq */ struct dentry *oos_root; /* O/ */ struct dentry **oos_dirs; /* O//d0-dXX */ - obd_seq oos_seq; /* seq number */ + u64 oos_seq; /* seq number */ struct list_head oos_seq_list; /* list to seq_list */ }; @@ -159,7 +159,7 @@ struct osd_obj_map { struct osd_mdobj { struct dentry *om_root; /* AGENT/ */ - obd_seq om_index; /* mdt index */ + u64 om_index; /* mdt index */ struct list_head om_list; /* list to omm_list */ }; @@ -704,7 +704,7 @@ int osd_oii_lookup(struct osd_device *dev, const struct lu_fid *fid, int osd_scrub_dump(struct seq_file *m, struct osd_device *dev); int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd, - obd_seq seq, struct lu_seq_range *range); + u64 seq, struct lu_seq_range *range); int osd_delete_from_remote_parent(const struct lu_env *env, struct osd_device *osd, diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index eae5c00..ae81124 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -1031,7 +1031,7 @@ static int osd_write_prep(const struct lu_env *env, struct dt_object *dt, } /* Check if a block is allocated or not */ -static int osd_is_mapped(struct inode *inode, obd_size offset) +static int osd_is_mapped(struct inode *inode, u64 offset) { sector_t (*fs_bmap)(struct address_space *, sector_t); diff --git a/lustre/osd-ldiskfs/osd_quota_fmt.h b/lustre/osd-ldiskfs/osd_quota_fmt.h index b797910..92fd080 100644 --- a/lustre/osd-ldiskfs/osd_quota_fmt.h +++ b/lustre/osd-ldiskfs/osd_quota_fmt.h @@ -49,8 +49,8 @@ struct lustre_disk_dqblk_v2 { /**< preferred limit on disk space (in QUOTABLOCK_SIZE) */ __u64 dqb_bsoftlimit; __u64 dqb_curspace; /**< current space occupied (in bytes) */ - obd_time dqb_btime; /**< time limit for excessive disk use */ - obd_time dqb_itime; /**< time limit for excessive inode use */ + s64 dqb_btime; /**< time limit for excessive disk use */ + s64 dqb_itime; /**< time limit for excessive inode use */ }; /* Number of entries in one blocks(14 entries) */ diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 4c60943..a847f40 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -465,7 +465,7 @@ int osd_statfs(const struct lu_env *env, struct dt_device *d, if (unlikely(rc != 0)) RETURN(rc); - osfs->os_bavail -= min_t(obd_size, + osfs->os_bavail -= min_t(u64, OSD_GRANT_FOR_LOCAL_OIDS / osfs->os_bsize, osfs->os_bavail); RETURN(0); diff --git a/lustre/osd-zfs/osd_index.c b/lustre/osd-zfs/osd_index.c index d14efbb..13fae10 100644 --- a/lustre/osd-zfs/osd_index.c +++ b/lustre/osd-zfs/osd_index.c @@ -527,7 +527,7 @@ static inline void osd_object_put(const struct lu_env *env, } static int osd_seq_exists(const struct lu_env *env, struct osd_device *osd, - obd_seq seq) + u64 seq) { struct lu_seq_range *range = &osd_oti_get(env)->oti_seq_range; struct seq_server_site *ss = osd_seq_site(osd); diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h index 40cba11..f14a003 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h @@ -224,7 +224,7 @@ struct osd_oi { struct osd_seq { uint64_t *os_compat_dirs; int os_subdir_count; /* subdir count for each seq */ - obd_seq os_seq; /* seq number */ + u64 os_seq; /* seq number */ struct list_head os_seq_list; /* list to seq_list */ }; @@ -461,7 +461,7 @@ int osd_ost_seq_exists(const struct lu_env *env, struct osd_device *osd, int osd_index_try(const struct lu_env *env, struct dt_object *dt, const struct dt_index_features *feat); int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd, - obd_seq seq, struct lu_seq_range *range); + u64 seq, struct lu_seq_range *range); void osd_zap_cursor_init_serialized(zap_cursor_t *zc, struct objset *os, uint64_t id, uint64_t dirhash); int osd_zap_cursor_init(zap_cursor_t **zc, struct objset *os, diff --git a/lustre/osd-zfs/osd_oi.c b/lustre/osd-zfs/osd_oi.c index 279dfb0..5b427a9 100644 --- a/lustre/osd-zfs/osd_oi.c +++ b/lustre/osd-zfs/osd_oi.c @@ -210,7 +210,7 @@ osd_oi_find_or_create(const struct lu_env *env, struct osd_device *o, * the object is located (tgt index) and it is MDT or OST object. */ int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd, - obd_seq seq, struct lu_seq_range *range) + u64 seq, struct lu_seq_range *range) { struct seq_server_site *ss = osd_seq_site(osd); @@ -264,7 +264,7 @@ int fid_is_on_ost(const struct lu_env *env, struct osd_device *osd, } static struct osd_seq *osd_seq_find_locked(struct osd_seq_list *seq_list, - obd_seq seq) + u64 seq) { struct osd_seq *osd_seq; @@ -275,8 +275,7 @@ static struct osd_seq *osd_seq_find_locked(struct osd_seq_list *seq_list, return NULL; } -static struct osd_seq *osd_seq_find(struct osd_seq_list *seq_list, - obd_seq seq) +static struct osd_seq *osd_seq_find(struct osd_seq_list *seq_list, u64 seq) { struct osd_seq *osd_seq; @@ -288,7 +287,7 @@ static struct osd_seq *osd_seq_find(struct osd_seq_list *seq_list, } static struct osd_seq *osd_find_or_add_seq(const struct lu_env *env, - struct osd_device *osd, obd_seq seq) + struct osd_device *osd, u64 seq) { struct osd_seq_list *seq_list = &osd->od_seq_list; struct osd_seq *osd_seq; @@ -373,7 +372,7 @@ osd_get_idx_for_ost_obj(const struct lu_env *env, struct osd_device *osd, { struct osd_seq *osd_seq; unsigned long b; - obd_id id; + u64 id; int rc; osd_seq = osd_find_or_add_seq(env, osd, fid_seq(fid)); -- 1.8.3.1