-static inline int const
-capa_hashfn(unsigned int uid, __u64 mdsid, unsigned long ino)
-{
- return (ino ^ uid) * (unsigned long)(mdsid + 1) % NR_CAPAHASH;
-}
-
-int capa_op(int flags)
-{
- if (flags & (FMODE_WRITE|MDS_OPEN_TRUNC))
- return CAPA_WRITE;
- else if (flags & FMODE_READ)
- return CAPA_READ;
-
- LBUG(); /* should be either MAY_READ or MAY_WRITE */
- return 0;
-}
-
-static struct obd_capa *
-find_capa(struct hlist_head *head, uid_t uid, int capa_op, __u64 mdsid,
- unsigned long ino, __u32 igen, int type)
-{
- struct hlist_node *pos;
- struct obd_capa *ocapa;
- uid_t ouid;
-
- hlist_for_each_entry(ocapa, pos, head, c_hash) {
- if (ocapa->c_capa.lc_ino != ino)
- continue;
- if (ocapa->c_capa.lc_igen != igen)
- continue;
- if (ocapa->c_capa.lc_mdsid != mdsid)
- continue;
- if ((ocapa->c_capa.lc_op & capa_op) != ocapa->c_capa.lc_op)
- continue;
- if (ocapa->c_type != type)
- continue;