Commit ad4bfe39 authored by Pavel Emelyanov's avatar Pavel Emelyanov

page-server: Fix dst_id encoding

First of all, 4 bits are not enough for type (shmem pagemap's is
28, which is 5 bits). Plus the encode trimmed bits from the id.

https://bugzilla.openvz.org/show_bug.cgi?id=2584Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f4e36cc5
......@@ -20,10 +20,10 @@ struct page_server_iov {
#define PS_IOV_ADD 1
#define PS_IOV_HOLE 2
#define PS_TYPE_BITS 4
#define PS_TYPE_BITS 8
#define PS_TYPE_MASK ((1 << PS_TYPE_BITS) - 1)
static inline u64 encode_pm_id(int type, int id)
static inline u64 encode_pm_id(int type, long id)
{
return ((u64)id) << PS_TYPE_BITS | type;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment