-int filter_verify_capa(int cmd, struct obd_export *exp, struct inode *inode,
- struct lustre_capa *capa)
+int filter_verify_fid(struct obd_export *exp, struct inode *inode,
+ struct lustre_capa *capa)
+{
+ struct lustre_id fid;
+ int rc;
+
+ if (!capa)
+ return 0;
+
+ ENTRY;
+ rc = fsfilt_get_md(exp->exp_obd, inode, &fid, sizeof(fid), EA_SID);
+ if (rc < 0) {
+ CERROR("get fid from object failed! rc:%d\n", rc);
+ RETURN(rc);
+ } else if (rc > 0) {
+ if (capa->lc_mdsid != id_group(&fid) ||
+ capa->lc_ino != id_ino(&fid))
+ RETURN(-EINVAL);
+ }
+
+ RETURN(0);
+}
+
+int
+filter_verify_capa(int cmd, struct obd_export *exp, struct lustre_capa *capa)