From f2fd9c3b0ca9695b90b0f75fe3ab3412b1dad52e Mon Sep 17 00:00:00 2001 From: sageweil Date: Fri, 7 Dec 2007 21:59:05 +0000 Subject: [PATCH] changed mds request format slightly, streamlined handler in mds/Server.cc git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2199 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/client/Client.cc | 2 +- trunk/ceph/include/ceph_fs.h | 5 ----- trunk/ceph/mds/Server.cc | 25 ++----------------------- trunk/ceph/mon/OSDMonitor.cc | 2 +- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/trunk/ceph/client/Client.cc b/trunk/ceph/client/Client.cc index cdf56673ed8ed..25ca5a1527728 100644 --- a/trunk/ceph/client/Client.cc +++ b/trunk/ceph/client/Client.cc @@ -3146,7 +3146,7 @@ int Client::ftruncate(int fd, off_t length) int Client::_ftruncate(Fh *fh, off_t length) { MClientRequest *req = new MClientRequest(CEPH_MDS_OP_TRUNCATE, messenger->get_myinst()); - req->head.args.truncate.ino = fh->inode->inode.ino; + req->set_filepath( filepath("", fh->inode->inode.ino) ); req->head.args.truncate.length = length; // FIXME where does FUSE maintain user information diff --git a/trunk/ceph/include/ceph_fs.h b/trunk/ceph/include/ceph_fs.h index 0979b1f054c4b..f895f88e87065 100644 --- a/trunk/ceph/include/ceph_fs.h +++ b/trunk/ceph/include/ceph_fs.h @@ -308,7 +308,6 @@ struct ceph_mds_request_head { __u32 mask; } stat; struct { - ceph_ino_t ino; __u32 mask; } fstat; struct { @@ -337,12 +336,8 @@ struct ceph_mds_request_head { __u32 mode; } open; struct { - ceph_ino_t ino; // optional __s64 length; } truncate; - struct { - ceph_ino_t ino; - } fsync; } args; }; diff --git a/trunk/ceph/mds/Server.cc b/trunk/ceph/mds/Server.cc index 404d2de39cf39..d99c82a4e2c62 100644 --- a/trunk/ceph/mds/Server.cc +++ b/trunk/ceph/mds/Server.cc @@ -535,28 +535,6 @@ void Server::handle_client_request(MClientRequest *req) req->get_oldest_client_tid()); } - - // ----- - // some ops are on ino's - switch (req->get_op()) { - case CEPH_MDS_OP_FSTAT: - ref = mdcache->get_inode(req->head.args.fstat.ino); - assert(ref); - break; - - case CEPH_MDS_OP_TRUNCATE: - if (!req->head.args.truncate.ino) - break; // can be called w/ either fh OR path - ref = mdcache->get_inode(req->head.args.truncate.ino); - assert(ref); - break; - - case CEPH_MDS_OP_FSYNC: - ref = mdcache->get_inode(req->head.args.fsync.ino); // fixme someday no ino needed? - assert(ref); - break; - } - // register + dispatch MDRequest *mdr = mdcache->request_start(req); if (!mdr) return; @@ -592,6 +570,7 @@ void Server::dispatch_client_request(MDRequest *mdr) // inodes ops. case CEPH_MDS_OP_STAT: case CEPH_MDS_OP_LSTAT: + case CEPH_MDS_OP_FSTAT: handle_client_stat(mdr); break; case CEPH_MDS_OP_UTIME: @@ -610,7 +589,7 @@ void Server::dispatch_client_request(MDRequest *mdr) handle_client_readdir(mdr); break; case CEPH_MDS_OP_FSYNC: - //handle_client_fsync(req, ref); + //handle_client_fsync(req); break; // funky. diff --git a/trunk/ceph/mon/OSDMonitor.cc b/trunk/ceph/mon/OSDMonitor.cc index bda005095856e..db3bc57841597 100644 --- a/trunk/ceph/mon/OSDMonitor.cc +++ b/trunk/ceph/mon/OSDMonitor.cc @@ -815,7 +815,7 @@ void OSDMonitor::tick() ps_t numps = osdmap.get_pg_num(); int minrep = 1; int maxrep = MIN(g_conf.num_osd, g_conf.osd_max_rep); - for (int nrep = 1; nrep <= maxrep; nrep++) { + for (int nrep = minrep; nrep <= maxrep; nrep++) { for (ps_t ps = 0; ps < numps; ++ps) { pg_t pgid = pg_t(pg_t::TYPE_REP, nrep, ps, -1); vector osds; -- 2.39.5