+ return !(open_flags & MDS_OPEN_DELAY_CREATE) &&
+ (open_flags & MDS_FMODE_WRITE) &&
+ !(open_flags & MDS_OPEN_LEASE);
+}
+
+/* do NOT or the MAY_*'s, you'll get the weakest */
+static inline int mds_accmode(u64 open_flags)
+{
+ unsigned int may_mask = 0;
+
+ if (open_flags & MDS_FMODE_READ)
+ may_mask |= MAY_READ;
+ if (open_flags & (MDS_FMODE_WRITE | MDS_OPEN_TRUNC | MDS_OPEN_APPEND))
+ may_mask |= MAY_WRITE;
+ if (open_flags & MDS_FMODE_EXEC)
+ may_mask = MAY_EXEC;
+
+ return may_mask;