diff options
author | Sage Weil <sage@newdream.net> | 2010-03-25 00:43:33 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-05-17 18:25:15 -0400 |
commit | 3143edd3a185f1fd370ebdd21b4151aa9f3283a3 (patch) | |
tree | 55253639685cc9aab6f228f780faca8dc57585aa /fs/ceph/mon_client.h | |
parent | 6f46cb29350963527b663c9eb4fe964daa9ae707 (diff) |
ceph: clean up statfs
Avoid unnecessary msgpool. Preallocate reply. Fix use-after-free race.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mon_client.h')
-rw-r--r-- | fs/ceph/mon_client.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/mon_client.h b/fs/ceph/mon_client.h index b958ad5afa06..cc89a86c8589 100644 --- a/fs/ceph/mon_client.h +++ b/fs/ceph/mon_client.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _FS_CEPH_MON_CLIENT_H | 2 | #define _FS_CEPH_MON_CLIENT_H |
3 | 3 | ||
4 | #include <linux/completion.h> | 4 | #include <linux/completion.h> |
5 | #include <linux/kref.h> | ||
5 | #include <linux/rbtree.h> | 6 | #include <linux/rbtree.h> |
6 | 7 | ||
7 | #include "messenger.h" | 8 | #include "messenger.h" |
@@ -44,13 +45,14 @@ struct ceph_mon_request { | |||
44 | * to the caller | 45 | * to the caller |
45 | */ | 46 | */ |
46 | struct ceph_mon_statfs_request { | 47 | struct ceph_mon_statfs_request { |
48 | struct kref kref; | ||
47 | u64 tid; | 49 | u64 tid; |
48 | struct rb_node node; | 50 | struct rb_node node; |
49 | int result; | 51 | int result; |
50 | struct ceph_statfs *buf; | 52 | struct ceph_statfs *buf; |
51 | struct completion completion; | 53 | struct completion completion; |
52 | unsigned long last_attempt, delay; /* jiffies */ | ||
53 | struct ceph_msg *request; /* original request */ | 54 | struct ceph_msg *request; /* original request */ |
55 | struct ceph_msg *reply; /* and reply */ | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | struct ceph_mon_client { | 58 | struct ceph_mon_client { |
@@ -72,7 +74,6 @@ struct ceph_mon_client { | |||
72 | 74 | ||
73 | /* msg pools */ | 75 | /* msg pools */ |
74 | struct ceph_msgpool msgpool_subscribe_ack; | 76 | struct ceph_msgpool msgpool_subscribe_ack; |
75 | struct ceph_msgpool msgpool_statfs_reply; | ||
76 | struct ceph_msgpool msgpool_auth_reply; | 77 | struct ceph_msgpool msgpool_auth_reply; |
77 | 78 | ||
78 | /* pending statfs requests */ | 79 | /* pending statfs requests */ |