-#define FSFILT_OP_UNLINK 1
-#define FSFILT_OP_RMDIR 2
-#define FSFILT_OP_RENAME 3
-#define FSFILT_OP_CREATE 4
-#define FSFILT_OP_MKDIR 5
-#define FSFILT_OP_SYMLINK 6
-#define FSFILT_OP_MKNOD 7
-#define FSFILT_OP_SETATTR 8
-#define FSFILT_OP_LINK 9
-#define FSFILT_OP_CANCEL_UNLINK 10
-#define FSFILT_OP_NOOP 15
-
-/* XXX BUG 3188 -- must return to one set of opcodes */
-#define KML_UNLINK 0x11
-#define KML_RMDIR 0x12
-#define KML_RENAME 0x13
-#define KML_CREATE 0x14
-#define KML_MKDIR 0x15
-#define KML_SYMLINK 0x16
-#define KML_MKNOD 0x17
-#define KML_LINK 0x19
-
-#define CACHE_UNLINK 0x21
-#define CACHE_RMDIR 0x22
-#define CACHE_RENAME 0x23
-#define CACHE_CREATE 0x24
-#define CACHE_MKDIR 0x25
-#define CACHE_SYMLINK 0x26
-#define CACHE_MKNOD 0x27
-#define CACHE_LINK 0x29
-#define CACHE_NOOP 0x2f
-
-#define KML_CACHE_UNLINK 0x31
-#define KML_CACHE_RMDIR 0x32
-#define KML_CACHE_RENAME 0x33
-#define KML_CACHE_CREATE 0x34
-#define KML_CACHE_MKDIR 0x35
-#define KML_CACHE_SYMLINK 0x36
-#define KML_CACHE_MKNOD 0x37
-#define KML_CACHE_LINK 0x39
-#define KML_CACHE_NOOP 0x3f
-
-/*for fsfilt set md ea*/
-#define LMV_EA 1
-#define LOV_EA 0
-
-static inline void *
-fsfilt_start_ops(struct fsfilt_operations *ops, struct inode *inode,
- int op, struct obd_trans_info *oti, int logs)
+static inline char *fsfilt_get_label(struct obd_device *obd,
+ struct super_block *sb)
+{
+ if (obd->obd_fsops->fs_getlabel == NULL)
+ return NULL;
+ if (obd->obd_fsops->fs_getlabel(sb)[0] == '\0')
+ return NULL;
+
+ return obd->obd_fsops->fs_getlabel(sb);
+}
+
+static inline int fsfilt_set_label(struct obd_device *obd,
+ struct super_block *sb, char *label)
+{
+ if (obd->obd_fsops->fs_setlabel == NULL)
+ return -ENOSYS;
+ return (obd->obd_fsops->fs_setlabel(sb, label));
+}
+
+static inline __u8 *fsfilt_uuid(struct obd_device *obd, struct super_block *sb)
+{
+ if (obd->obd_fsops->fs_uuid == NULL)
+ return NULL;
+
+ return obd->obd_fsops->fs_uuid(sb);
+}
+
+static inline lvfs_sbdev_type fsfilt_journal_sbdev(struct obd_device *obd,
+ struct super_block *sb)
+{
+ if (obd && obd->obd_fsops && obd->obd_fsops->fs_journal_sbdev)
+ return obd->obd_fsops->fs_journal_sbdev(sb);
+ return (lvfs_sbdev_type)0;
+}
+
+#define FSFILT_OP_UNLINK 1
+#define FSFILT_OP_RMDIR 2
+#define FSFILT_OP_RENAME 3
+#define FSFILT_OP_CREATE 4
+#define FSFILT_OP_MKDIR 5
+#define FSFILT_OP_SYMLINK 6
+#define FSFILT_OP_MKNOD 7
+#define FSFILT_OP_SETATTR 8
+#define FSFILT_OP_LINK 9
+#define FSFILT_OP_CANCEL_UNLINK 10
+#define FSFILT_OP_JOIN 11
+#define FSFILT_OP_NOOP 15
+#define FSFILT_OP_UNLINK_PARTIAL_CHILD 21
+#define FSFILT_OP_UNLINK_PARTIAL_PARENT 22
+#define FSFILT_OP_CREATE_PARTIAL_CHILD 23
+
+#define __fsfilt_check_slow(obd, start, msg) \
+do { \
+ if (time_before(jiffies, start + 15 * HZ)) \
+ break; \
+ else if (time_before(jiffies, start + 30 * HZ)) \
+ CDEBUG(D_VFSTRACE, "%s: slow %s %lus\n", obd->obd_name, \
+ msg, (jiffies-start) / HZ); \
+ else if (time_before(jiffies, start + DISK_TIMEOUT * HZ)) \
+ CWARN("%s: slow %s %lus\n", obd->obd_name, msg, \
+ (jiffies - start) / HZ); \
+ else \
+ CERROR("%s: slow %s %lus\n", obd->obd_name, msg, \
+ (jiffies - start) / HZ); \
+} while (0)
+
+#define fsfilt_check_slow(obd, start, msg) \
+do { \
+ __fsfilt_check_slow(obd, start, msg); \
+ start = jiffies; \
+} while (0)
+
+static inline void *fsfilt_start_log(struct obd_device *obd,
+ struct inode *inode, int op,
+ struct obd_trans_info *oti, int logs)