Whamcloud - gitweb
b=19427 correct lmm_object_id and reserve fids for fid-on-OST.
[fs/lustre-release.git] / lustre / osd / osd_internal.h
index 9c5db4a..0b3aad3 100644 (file)
@@ -306,5 +306,21 @@ static inline int osd_invariant(const struct osd_object *obj)
 #define osd_invariant(obj) (1)
 #endif
 
+/* The on-disk extN format reserves inodes 0-11 for internal filesystem
+ * use, and these inodes will be invisible on client side, so the valid
+ * sequence for IGIF fid is 12-0xffffffff. But root inode (2#) will be seen
+ * on server side (osd), and it should be valid too here.
+ */
+#define OSD_ROOT_SEQ            2
+static inline int osd_fid_is_root(const struct lu_fid *fid)
+{
+        return fid_seq(fid) == OSD_ROOT_SEQ;
+}
+
+static inline int osd_fid_is_igif(const struct lu_fid *fid)
+{
+        return fid_is_igif(fid) || osd_fid_is_root(fid);
+}
+
 #endif /* __KERNEL__ */
 #endif /* _OSD_INTERNAL_H */