+/*
+ * Translates old vtx IOCTLs to new ones
+ *
+ * This keeps new kernel versions compatible with old userspace programs.
+ */
+static inline unsigned int vtx_fix_command(unsigned int cmd)
+{
+ switch (cmd) {
+ case VTXIOCGETINFO_OLD:
+ cmd = VTXIOCGETINFO;
+ break;
+ case VTXIOCCLRPAGE_OLD:
+ cmd = VTXIOCCLRPAGE;
+ break;
+ case VTXIOCCLRFOUND_OLD:
+ cmd = VTXIOCCLRFOUND;
+ break;
+ case VTXIOCPAGEREQ_OLD:
+ cmd = VTXIOCPAGEREQ;
+ break;
+ case VTXIOCGETSTAT_OLD:
+ cmd = VTXIOCGETSTAT;
+ break;
+ case VTXIOCGETPAGE_OLD:
+ cmd = VTXIOCGETPAGE;
+ break;
+ case VTXIOCSTOPDAU_OLD:
+ cmd = VTXIOCSTOPDAU;
+ break;
+ case VTXIOCPUTPAGE_OLD:
+ cmd = VTXIOCPUTPAGE;
+ break;
+ case VTXIOCSETDISP_OLD:
+ cmd = VTXIOCSETDISP;
+ break;
+ case VTXIOCPUTSTAT_OLD:
+ cmd = VTXIOCPUTSTAT;
+ break;
+ case VTXIOCCLRCACHE_OLD:
+ cmd = VTXIOCCLRCACHE;
+ break;
+ case VTXIOCSETVIRT_OLD:
+ cmd = VTXIOCSETVIRT;
+ break;
+ }
+ return cmd;
+}
+