Skip to content

Commit

Permalink
libceph: initialize last_linger_id with a large integer
Browse files Browse the repository at this point in the history
osdc->last_linger_id is a counter for lreq->linger_id, which is used
for watch cookies.  Starting with a large integer should ease the task
of telling apart kernel and userspace clients.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Ilya Dryomov committed Nov 10, 2016
1 parent 3890dce commit 264048a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/ceph/osd_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ struct ceph_watch_item {
struct ceph_entity_addr addr;
};

#define CEPH_LINGER_ID_START 0xffff000000000000ULL

struct ceph_osd_client {
struct ceph_client *client;

Expand Down
1 change: 1 addition & 0 deletions net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -4094,6 +4094,7 @@ int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client)
osd_init(&osdc->homeless_osd);
osdc->homeless_osd.o_osdc = osdc;
osdc->homeless_osd.o_osd = CEPH_HOMELESS_OSD;
osdc->last_linger_id = CEPH_LINGER_ID_START;
osdc->linger_requests = RB_ROOT;
osdc->map_checks = RB_ROOT;
osdc->linger_map_checks = RB_ROOT;
Expand Down

0 comments on commit 264048a

Please sign in to comment.