From 38dcfadd11f3d2edcf3b115bac1577c6a41c75c5 Mon Sep 17 00:00:00 2001 From: lsy Date: Thu, 15 Sep 2005 02:57:02 +0000 Subject: [PATCH] remove capa_op from hashfn, to allow search CAPA_READ|CAPA_WRITE. --- lustre/mds/mds_capa.c | 1 + lustre/obdclass/capa.c | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lustre/mds/mds_capa.c b/lustre/mds/mds_capa.c index 8a87a54..dd38af6 100644 --- a/lustre/mds/mds_capa.c +++ b/lustre/mds/mds_capa.c @@ -565,3 +565,4 @@ out: body->valid |= OBD_MD_CAPA; RETURN(rc); } + diff --git a/lustre/obdclass/capa.c b/lustre/obdclass/capa.c index 3bd0a71..28e882e 100644 --- a/lustre/obdclass/capa.c +++ b/lustre/obdclass/capa.c @@ -68,10 +68,9 @@ EXPORT_SYMBOL(capa_list); EXPORT_SYMBOL(ll_capa_timer); static inline int const -capa_hashfn(unsigned int uid, int capa_op, __u64 mdsid, unsigned long ino) +capa_hashfn(unsigned int uid, __u64 mdsid, unsigned long ino) { - return (ino ^ uid) * (unsigned long)capa_op * (unsigned long)(mdsid + 1) - % NR_CAPAHASH; + return (ino ^ uid) * (unsigned long)(mdsid + 1) % NR_CAPAHASH; } int capa_op(int flags) @@ -285,8 +284,7 @@ get_new_capa_locked(struct hlist_head *head, int type, struct lustre_capa *capa) struct obd_capa * capa_get(uid_t uid, int capa_op,__u64 mdsid, unsigned long ino, int type) { - struct hlist_head *head = capa_hash + - capa_hashfn(uid, capa_op, mdsid, ino); + struct hlist_head *head = capa_hash + capa_hashfn(uid, mdsid, ino); struct obd_capa *ocapa; ocapa = find_capa_locked(head, uid, capa_op, mdsid, ino, type); @@ -319,7 +317,7 @@ struct obd_capa *capa_renew(struct lustre_capa *capa, int type) __u64 mdsid = capa->lc_mdsid; unsigned long ino = capa->lc_ino; struct hlist_head *head = capa_hash + - capa_hashfn(uid, capa_op, mdsid, ino); + capa_hashfn(uid, mdsid, ino); struct obd_capa *ocapa; spin_lock(&capa_lock); -- 1.8.3.1