From 6f8b5dbd6eb7cdaaaba1d587f6cde4cbbe896c71 Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 9 Oct 2006 13:28:02 +0000 Subject: [PATCH] small cleanups --- lustre/include/lustre/lustre_idl.h | 4 ++-- lustre/osd/osd_handler.c | 27 +++++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 7267986..84fc13b 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -625,7 +625,7 @@ struct md_op_data { #endif #endif loff_t attr_blocks; - + /* Size-on-MDS epoch and flags. */ __u64 ioepoch; __u32 flags; @@ -1915,7 +1915,7 @@ extern void lustre_swab_lustre_capa(struct lustre_capa *c); /* lustre_capa.lc_opc */ enum { /* MDS only fid capability */ - CAPA_OPC_BODY_WRITE = 1, /* write fid data */ + CAPA_OPC_BODY_WRITE = 1<<0, /* write fid data */ CAPA_OPC_BODY_READ = 1<<1, /* read fid data */ CAPA_OPC_INDEX_LOOKUP = 1<<2, /* lookup fid */ CAPA_OPC_INDEX_INSERT = 1<<3, /* insert fid */ diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 45c6af0..ff24749 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -455,8 +455,8 @@ static int osd_inode_remove(const struct lu_env *env, result = dir->i_op->unlink(dir, dentry); if (S_ISDIR(obj->oo_inode->i_mode)) { /* - * The nlink of a dir was not decreased to - * less than 2. see ldiskfs_unlink() and + * The nlink of a dir was not decreased to + * less than 2. see ldiskfs_unlink() and * ldiskfs_dec_count(). */ obj->oo_inode->i_nlink = 0; @@ -716,7 +716,7 @@ static int osd_init_capa_ctxt(const struct lu_env *env, struct dt_device *d, enum { /* Insert/Delete IAM * EXT3_INDEX_EXTRA_TRANS_BLOCKS(8) + EXT3_SINGLEDATA_TRANS_BLOCKS 8 - * XXX Note: maybe iam need more,since iam have more level than Ext3 + * XXX Note: maybe iam need more,since iam have more level than Ext3 * htree */ INSERT_IAM_CREDITS = 16, @@ -759,11 +759,11 @@ static int osd_credit_get(const struct lu_env *env, struct dt_device *d, default: CERROR("Not recorgonized op %d", op); LBUG(); - return -EINVAL; + return -EINVAL; } return (-EINVAL); } - + static struct dt_device_operations osd_dt_ops = { .dt_root_get = osd_root_get, .dt_statfs = osd_statfs, @@ -1234,7 +1234,7 @@ static int osd_object_create(const struct lu_env *env, struct dt_object *dt, LASSERT(ergo(result == 0, dt_object_exists(dt))); LASSERT(osd_invariant(obj)); - return result; + RETURN(result); } static void osd_object_ref_add(const struct lu_env *env, @@ -1412,8 +1412,8 @@ static int osd_dir_page_build(const struct lu_env *env, int first, recsize = (sizeof *ent + len + 3) & ~3; hash = iops->store(env, it); *end = hash; - CDEBUG(D_INODE, "%p %p %d "DFID": %#8.8x (%d)\"%*.*s\"\n", - area, ent, nob, PFID(fid), hash, len, len, len, name); + CDEBUG(D_INODE, "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"\n", + name, ent, nob, PFID(fid), hash, len, len, len, name); if (nob >= recsize) { ent->lde_fid = *fid; ent->lde_hash = hash; @@ -1448,7 +1448,10 @@ static int osd_readpage(const struct lu_env *env, struct dt_it *it; struct osd_object *obj = osd_dt_obj(dt); struct dt_it_ops *iops; - int i, rc, rc1 = 0, nob; + int i; + int rc; + int rc1; + int nob; LASSERT(dt_object_exists(dt)); LASSERT(osd_invariant(obj)); @@ -1481,11 +1484,11 @@ static int osd_readpage(const struct lu_env *env, */ rc = iops->load(env, it, rdpg->rp_hash); - /* When spliting, it need read entries from some offset by computing + /* + * When spliting, it need read entries from some offset by computing * not by some entries offset like readdir, so it might return 0 here. */ - if (rc == 0) - rc1 = -ERANGE; + rc1 = rc == 0 ? -ERANGE : 0; if (rc >= 0) { struct page *pg; /* no, Richard, it _is_ initialized */ -- 1.8.3.1