Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1923546
b: refs/heads/develop-4.19
c: 82dcaba
h: refs/heads/develop-4.4
  • Loading branch information
idryomov committed Mar 25, 2016
1 parent 2a19f09 commit f980001
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 96 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ refs/heads/stable-4.4-rk3288-linux-v2.x: 0cac436bf5c08a436009dd944fad317b159d904
"refs/heads/stable-4.4-rk3399pro_npu-linux": b592dda51a9b4f8531d5bfe79dbed2e117e801fc
"refs/heads/stable-4.4-rk3399pro_npu_pvtm32k-linux": 028d7605cf6ba614f547be57f080423bbbb7df3b
"refs/heads/stable-4.4-rk3399pro_npu-pcie-linux": bc673f1b71315f2d76827693f74a429894557cb7
refs/heads/develop-4.19: 0f9af169a1db62c33d87e4cfda46493907bd5537
refs/heads/develop-4.19: 82dcabad750a36a2b749889bc89c5a3188775b2e
3 changes: 2 additions & 1 deletion branches/develop-4.19/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3764,7 +3764,6 @@ void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
dout("handle_map epoch %u len %d\n", epoch, (int)maplen);

/* do we need it? */
ceph_monc_got_mdsmap(&mdsc->fsc->client->monc, epoch);
mutex_lock(&mdsc->mutex);
if (mdsc->mdsmap && epoch <= mdsc->mdsmap->m_epoch) {
dout("handle_map epoch %u <= our %u\n",
Expand All @@ -3791,6 +3790,8 @@ void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
mdsc->fsc->sb->s_maxbytes = mdsc->mdsmap->m_max_file_size;

__wake_requests(mdsc, &mdsc->waiting_for_map);
ceph_monc_got_map(&mdsc->fsc->client->monc, CEPH_SUB_MDSMAP,
mdsc->mdsmap->m_epoch);

mutex_unlock(&mdsc->mutex);
schedule_delayed(mdsc);
Expand Down
2 changes: 1 addition & 1 deletion branches/develop-4.19/fs/ceph/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt,
goto fail;
}
fsc->client->extra_mon_dispatch = extra_mon_dispatch;
fsc->client->monc.want_mdsmap = 1;
ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, 0, true);

fsc->mount_options = fsopt;

Expand Down
2 changes: 2 additions & 0 deletions branches/develop-4.19/include/linux/ceph/ceph_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static inline u64 ceph_sanitize_features(u64 features)
*/
#define CEPH_FEATURES_SUPPORTED_DEFAULT \
(CEPH_FEATURE_NOSRCADDR | \
CEPH_FEATURE_SUBSCRIBE2 | \
CEPH_FEATURE_RECONNECT_SEQ | \
CEPH_FEATURE_PGID64 | \
CEPH_FEATURE_PGPOOL3 | \
Expand All @@ -127,6 +128,7 @@ static inline u64 ceph_sanitize_features(u64 features)

#define CEPH_FEATURES_REQUIRED_DEFAULT \
(CEPH_FEATURE_NOSRCADDR | \
CEPH_FEATURE_SUBSCRIBE2 | \
CEPH_FEATURE_RECONNECT_SEQ | \
CEPH_FEATURE_PGID64 | \
CEPH_FEATURE_PGPOOL3 | \
Expand Down
4 changes: 2 additions & 2 deletions branches/develop-4.19/include/linux/ceph/ceph_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ struct ceph_client_mount {
#define CEPH_SUBSCRIBE_ONETIME 1 /* i want only 1 update after have */

struct ceph_mon_subscribe_item {
__le64 have_version; __le64 have;
__u8 onetime;
__le64 start;
__u8 flags;
} __attribute__ ((packed));

struct ceph_mon_subscribe_ack {
Expand Down
28 changes: 20 additions & 8 deletions branches/develop-4.19/include/linux/ceph/mon_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,21 @@ struct ceph_mon_client {

bool hunting;
int cur_mon; /* last monitor i contacted */
unsigned long sub_sent, sub_renew_after;
unsigned long sub_renew_after;
unsigned long sub_renew_sent;
struct ceph_connection con;

/* pending generic requests */
struct rb_root generic_request_tree;
int num_generic_requests;
u64 last_tid;

/* mds/osd map */
int want_mdsmap;
int want_next_osdmap; /* 1 = want, 2 = want+asked */
u32 have_osdmap, have_mdsmap;
/* subs, indexed with CEPH_SUB_* */
struct {
struct ceph_mon_subscribe_item item;
bool want;
u32 have; /* epoch */
} subs[3];

#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_file;
Expand All @@ -93,14 +96,23 @@ extern int ceph_monmap_contains(struct ceph_monmap *m,
extern int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl);
extern void ceph_monc_stop(struct ceph_mon_client *monc);

enum {
CEPH_SUB_MDSMAP = 0,
CEPH_SUB_MONMAP,
CEPH_SUB_OSDMAP,
};

extern const char *ceph_sub_str[];

/*
* The model here is to indicate that we need a new map of at least
* epoch @want, and also call in when we receive a map. We will
* epoch @epoch, and also call in when we receive a map. We will
* periodically rerequest the map from the monitor cluster until we
* get what we want.
*/
extern int ceph_monc_got_mdsmap(struct ceph_mon_client *monc, u32 have);
extern int ceph_monc_got_osdmap(struct ceph_mon_client *monc, u32 have);
bool ceph_monc_want_map(struct ceph_mon_client *monc, int sub, u32 epoch,
bool continuous);
void ceph_monc_got_map(struct ceph_mon_client *monc, int sub, u32 epoch);

extern void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc);
extern int ceph_monc_wait_osdmap(struct ceph_mon_client *monc, u32 epoch,
Expand Down
17 changes: 11 additions & 6 deletions branches/develop-4.19/net/ceph/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,20 @@ static int monc_show(struct seq_file *s, void *p)
struct ceph_mon_generic_request *req;
struct ceph_mon_client *monc = &client->monc;
struct rb_node *rp;
int i;

mutex_lock(&monc->mutex);

if (monc->have_mdsmap)
seq_printf(s, "have mdsmap %u\n", (unsigned int)monc->have_mdsmap);
if (monc->have_osdmap)
seq_printf(s, "have osdmap %u\n", (unsigned int)monc->have_osdmap);
if (monc->want_next_osdmap)
seq_printf(s, "want next osdmap\n");
for (i = 0; i < ARRAY_SIZE(monc->subs); i++) {
seq_printf(s, "have %s %u", ceph_sub_str[i],
monc->subs[i].have);
if (monc->subs[i].want)
seq_printf(s, " want %llu%s",
le64_to_cpu(monc->subs[i].item.start),
(monc->subs[i].item.flags &
CEPH_SUBSCRIBE_ONETIME ? "" : "+"));
seq_putc(s, '\n');
}

for (rp = rb_first(&monc->generic_request_tree); rp; rp = rb_next(rp)) {
__u16 op;
Expand Down
Loading

0 comments on commit f980001

Please sign in to comment.