/- improved monitor read model
- osd bugfixes
+kclient review
+- andi
+ - server-specified max file size
+ - pr_debug
+ - top of file comments
+
bugs
- premature filejournal trimming?
+- mount.ceph doesn't update /etc/mtab
later
- authentication
OPTION(journaler_prefetch_periods, 0, OPT_INT, 50), // * journal object size (1~MB? see above)
OPTION(journaler_batch_interval, 0, OPT_DOUBLE, .001), // seconds.. max add'l latency we artificially incur
OPTION(journaler_batch_max, 0, OPT_LONGLONG, 0), // max bytes we'll delay flushing; disable, for now....
+ OPTION(mds_max_file_size, 0, OPT_LONGLONG, 1ULL << 40),
OPTION(mds_cache_size, 0, OPT_INT, 100000),
OPTION(mds_cache_mid, 0, OPT_FLOAT, .7),
OPTION(mds_mem_max, 0, OPT_INT, 1048576), // KB
long long unsigned journaler_batch_max;
// mds
+ __u64 mds_max_file_size;
int mds_cache_size;
float mds_cache_mid;
int mds_mem_max;
#include "msgr.h"
#include "rados.h"
-/*
- * Max file size is a policy choice; in reality we are limited
- * by 2^64.
- */
-#define CEPH_FILE_MAX_SIZE (1ULL << 40) /* 1 TB */
-
/*
* subprotocol versions. when specific messages types or high-level
* protocols change, bump the affected components. we keep rev
#define CEPH_OSD_PROTOCOL 6 /* cluster internal */
#define CEPH_MDS_PROTOCOL 9 /* cluster internal */
#define CEPH_MON_PROTOCOL 4 /* cluster internal */
-#define CEPH_OSDC_PROTOCOL 19 /* public/client */
-#define CEPH_MDSC_PROTOCOL 26 /* public/client */
-#define CEPH_MONC_PROTOCOL 14 /* public/client */
+#define CEPH_OSDC_PROTOCOL 19 /* server/client */
+#define CEPH_MDSC_PROTOCOL 27 /* server/client */
+#define CEPH_MONC_PROTOCOL 14 /* server/client */
/* past end of file? */
i_size = inode->i_size; /* caller holds i_mutex */
- if (i_size + len > CEPH_FILE_MAX_SIZE) {
+ if (i_size + len > inode->i_sb->s_maxbytes) {
/* file is too big */
r = -EINVAL;
goto fail;
spin_unlock(&inode->i_lock);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
filemap_write_and_wait_range(&inode->i_data, 0,
- CEPH_FILE_MAX_SIZE);
+ inode->i_sb->s_maxbytes);
#else
# warning i may not flush all data after a snapshot + truncate.. i export need 2.6.30
filemap_write_and_wait(&inode->i_data);
if (ia_valid & ATTR_SIZE) {
dout(10, "setattr %p size %lld -> %lld\n", inode,
inode->i_size, attr->ia_size);
- if (attr->ia_size > CEPH_FILE_MAX_SIZE) {
+ if (attr->ia_size > inode->i_sb->s_maxbytes) {
err = -EINVAL;
goto out;
}
} else {
mdsc->mdsmap = newmap; /* first mds map */
}
+ mdsc->client->sb->s_maxbytes = mdsc->mdsmap->m_max_file_size;
__wake_requests(mdsc, &mdsc->waiting_for_map);
if (m == NULL)
return ERR_PTR(-ENOMEM);
- ceph_decode_need(p, end, 8*sizeof(u32), bad);
+ ceph_decode_need(p, end, 8*sizeof(u32) + sizeof(u64), bad);
ceph_decode_32(p, m->m_epoch);
ceph_decode_32(p, m->m_client_epoch);
ceph_decode_32(p, m->m_last_failure);
ceph_decode_32(p, m->m_root);
ceph_decode_32(p, m->m_session_timeout);
ceph_decode_32(p, m->m_session_autoclose);
+ ceph_decode_64(p, m->m_max_file_size);
ceph_decode_32(p, m->m_max_mds);
m->m_addr = kzalloc(m->m_max_mds*sizeof(*m->m_addr), GFP_NOFS);
u32 m_root;
u32 m_session_timeout; /* seconds */
u32 m_session_autoclose; /* seconds */
+ u64 m_max_file_size;
u32 m_max_mds; /* size of m_addr, m_state arrays */
struct ceph_entity_addr *m_addr; /* mds addrs */
s32 *m_state; /* states */
dout(10, "set_super %p data %p\n", s, data);
s->s_flags = client->mount_args.sb_flags;
- s->s_maxbytes = min((u64)MAX_LFS_FILESIZE, CEPH_FILE_MAX_SIZE);
+ s->s_maxbytes = 1ULL << 40; /* temp value until we get mdsmap */
s->s_fs_info = client;
client->sb = s;
__u32 session_timeout;
__u32 session_autoclose;
+ __u64 max_file_size;
vector<__u32> data_pg_pools; // file data pg_pools available to clients (via an ioctl). first is the default.
__u32 cas_pg_pool; // where CAS objects go
// hack.. this doesn't really belong here
session_timeout = (int)g_conf.mds_session_timeout;
session_autoclose = (int)g_conf.mds_session_autoclose;
+ max_file_size = g_conf.mds_max_file_size;
}
utime_t get_session_timeout() {
::encode(root, bl);
::encode(session_timeout, bl);
::encode(session_autoclose, bl);
+ ::encode(max_file_size, bl);
::encode(max_mds, bl);
::encode(mds_info, bl);
::encode(data_pg_pools, bl);
::decode(root, p);
::decode(session_timeout, p);
::decode(session_autoclose, p);
+ ::decode(max_file_size, p);
::decode(max_mds, p);
::decode(mds_info, p);
::decode(data_pg_pools, p);