tmem: cleanup: drop unused sub command
authorBob Liu <lliubbo@gmail.com>
Thu, 12 Dec 2013 11:05:01 +0000 (19:05 +0800)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Jan 2014 07:53:57 +0000 (08:53 +0100)
TMEM_READ/TMEM_WRITE/TMEM_XCHG/TMEM_NEW_PAGE are never used, drop them to make
things simple and clean.

To be clear - we are bit lucky here - as none of the other implementors
of the tmem API are using it (Windows GPLPV code, SLES11, Linux upstream).

The spec says that the operations can return an error code (-ENOSYS for
example) so we are OK doing that.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/tmem.c
xen/include/public/tmem.h

index 3d15eaddc75eb93ed23117332f5ebb0f1b64a67e..0991eeb3110fc2332063d3d562947f18646eb3e9 100644 (file)
@@ -2753,11 +2753,6 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
         rc = do_tmem_new_pool(TMEM_CLI_ID_NULL, 0, op.u.creat.flags,
                               op.u.creat.uuid[0], op.u.creat.uuid[1]);
         break;
-    case TMEM_NEW_PAGE:
-        tmem_ensure_avail_pages();
-        rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0, 0,
-                         tmem_cli_buf_null);
-        break;
     case TMEM_PUT_PAGE:
         tmem_ensure_avail_pages();
         rc = do_tmem_put(pool, oidp, op.u.gen.index, op.u.gen.cmfn, 0, 0,
@@ -2783,25 +2778,9 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops)
         flush = 1;
         rc = do_tmem_destroy_pool(op.pool_id);
         break;
-    case TMEM_READ:
-        rc = do_tmem_get(pool, oidp, op.u.gen.index, op.u.gen.cmfn,
-                         op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, tmem_cli_buf_null);
-        break;
-    case TMEM_WRITE:
-        rc = do_tmem_put(pool, oidp,
-                         op.u.gen.index, op.u.gen.cmfn,
-                         op.u.gen.tmem_offset, op.u.gen.pfn_offset,
-                         op.u.gen.len, tmem_cli_buf_null);
-        break;
-    case TMEM_XCHG:
-        /* need to hold global lock to ensure xchg is atomic */
-        tmem_client_warn("tmem_xchg op not implemented yet\n");
-        rc = 0;
-        break;
     default:
         tmem_client_warn("tmem: op %d not implemented\n", op.cmd);
-        rc = 0;
+        rc = -ENOSYS;
         break;
     }
 
index 5eb2fb467f1c3f47c22cdaa91a7f2335d492cbf9..4fd2fc6e283eddaad93bbd4fcc2af65409ca0de0 100644 (file)
 #define TMEM_CONTROL               0
 #define TMEM_NEW_POOL              1
 #define TMEM_DESTROY_POOL          2
-#define TMEM_NEW_PAGE              3
 #define TMEM_PUT_PAGE              4
 #define TMEM_GET_PAGE              5
 #define TMEM_FLUSH_PAGE            6
 #define TMEM_FLUSH_OBJECT          7
+#if __XEN_INTERFACE_VERSION__ < 0x00040400
+#define TMEM_NEW_PAGE              3
 #define TMEM_READ                  8
 #define TMEM_WRITE                 9
 #define TMEM_XCHG                 10
+#endif
 
 /* Privileged commands to HYPERVISOR_tmem_op() */
 #define TMEM_AUTH                 101