aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* ceph: pr_info when mds reconnect completesSage Weil2009-11-11
| | | | | | | This helps the user know what's going on during the (involved) reconnect process. They already see when the mds fails and reconnect starts. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: initialize i_size/i_rbytes on snapdirSage Weil2009-11-11
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: exclude snapdir from readdir resultsSage Weil2009-11-11
| | | | | | It was hidden from sync readdir, but not the cached dcache version. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove recon_gen logicSage Weil2009-11-10
| | | | | | | | We don't get an explicit affirmative confirmation that our caps reconnect, nor do we necessarily want to pay that cost. So, take all this code out for now. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: separate banner and connect during handshake into distinct stagesSage Weil2009-11-10
| | | | | | | | We need to make sure we only swab the address during the banner once. So break process_banner out of process_connect, and clean up the surrounding code so that these are distinct phases of the handshake. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: do not confuse stale and dead (unreconnected) capsSage Weil2009-11-09
| | | | | | | | | | | | We were using the cap_gen to track both stale caps (caps that timed out due to temporarily losing touch with the mds) and dead caps that did not reconnect after an MDS failure. Introduce a recon_gen counter to track reconnections to restarted MDSs and kill dead caps based on that instead. Rename gen to cap_gen while we're at it to make it more clear which is which. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: make CRUSH hash function a bucket propertySage Weil2009-11-07
| | | | | | | | Make the integer hash function a property of the bucket it is used on. This allows us to gracefully add support for new hash functions without starting from scatch. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: make object hash a pg_pool propertySage Weil2009-11-07
| | | | | | | | | The object will be hashed to a placement seed (ps) based on the pg_pool's hash function. This allows new hashes to be introduced into an existing object store, or selection of a hash appropriate to the objects that will be stored in a particular pool. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use strong hash function for mapping objects to pgsSage Weil2009-11-06
| | | | | | | | | | | | | | | We were using the (weak) dcache hash function, but it was leaving lower bits consecutive for consecutive (inode) objects. We really want to make the object to pg mapping random and uniform, so use a proper hash function here. This is Robert Jenkin's public domain hash function (with some minor cleanup): http://burtleburtle.net/bob/hash/evahash.html This is a protocol revision. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: make CRUSH hash functions non-inlineSage Weil2009-11-06
| | | | | | | These are way to big to be inline. I missed crush/* when doing the inline audit for akpm's review. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: clean up 'osd%d down' console msgSage Weil2009-11-06
| | | | | | No ceph prefix. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: convert port endiannessSage Weil2009-11-04
| | | | | | The port is informational only, but we should make it correct. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix sparse endian warningSage Weil2009-11-04
| | | | | | Use the __le macro, even though for -1 it doesn't matter. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix endian conversions for ceph_pgSage Weil2009-11-04
| | | | | | | | The endian conversions don't quite work with the old union ceph_pg. Just make it a regular struct, and make each field __le. This is simpler and it has the added bonus of actually working. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use fixed endian encoding for ceph_entity_addrSage Weil2009-11-03
| | | | | | | | | We exchange struct ceph_entity_addr over the wire and store it on disk. The sockaddr_storage.ss_family field, however, is host endianness. So, fix ss_family endianness to big endian when sending/receiving over the wire. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: init/destroy bdi in client create/destroy helpersSage Weil2009-11-02
| | | | | | This keeps bdi setup/teardown in line with client life cycle. Signed-off-by: Sage Weil <sage@newdream.net>
* crush: always return a value from crush_bucket_chooseSage Weil2009-11-01
| | | | | | | | | | | Even when we encounter a corrupt bucket. We still BUG(). This fixes the warning fs/ceph/crush/mapper.c: In function 'crush_choose': fs/ceph/crush/mapper.c:352: warning: control may reach end of non-void function 'crush_bucket_choose' being inlined Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix uninitialized err variableSage Weil2009-11-01
| | | | | | | | Fixes warning fs/ceph/xattr.c: In function '__build_xattrs': fs/ceph/xattr.c:353: warning: 'err' may be used uninitialized in this function Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix intra strip unit length calculationNoah Watkins2009-10-30
| | | | | | | | | | Commit 645a102581b3639836b17d147c35d574fd6e8267 fixes calculation of object offset for layouts with multiple stripes per object. This updates the calculation of the length written to take into account multiple stripes per object. Signed-off-by: Noah Watkins <noah@noahdesu.com> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix object striping calculation for non-default striping schemesSage Weil2009-10-28
| | | | | | | | | | | We were incorrectly calculationing of object offset. If we have multiple stripe units per object, we need to shift to the start of the current su in addition to the offset within the su. Also rename bno to ono (object number) to avoid some variable naming confusion. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: correct comment to match striping calculationSage Weil2009-10-28
| | | | | | | | The object extent offset is the file offset _modulo_ the stripe unit. The code was correct, the comment was wrong. Reported-by: Noah Watkins <jayhawk@soe.ucsc.edu> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove redundant use of le32_to_cpuNoah Watkins2009-10-28
| | | | | | | | Using stripe unit size calculated and saved on the stack to avoid a redundant call to le32_to_cpu. Signed-off-by: Noah Watkins <noah@noahdesu.com> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: replace list_entry with container_ofNoah Watkins2009-10-28
| | | | | | | | Usage of non-list.h list_entry function for container_of functionality replaced with direct use of container_of. Signed-off-by: Noah Watkins <noah@noahdesu.com> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: allocate and parse mount args before client instanceSage Weil2009-10-27
| | | | | | | | This simplifies much of the error handling during mount. It also means that we have the mount args before client creation, and we can initialize based on those options. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix, clean up string mount arg parsingSage Weil2009-10-27
| | | | | | | Clearly demark int and string argument options, and do not try to convert string arguments to ints. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: silence uninitialized variable warningSage Weil2009-10-27
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: reduce parse_mount_args stack usageSage Weil2009-10-27
| | | | | | | Since we've increased the max mon count, we shouldn't put the addr array on the parse_mount_args stack. Put it on the heap instead. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove small mon addr limit; use CEPH_MAX_MON where appropriateSage Weil2009-10-22
| | | | | | | | Get rid of separate max mon limit; use the system limit instead. This allows mounts when there are lots of mon addrs provided by mount.ceph (as with a host with lots of A/AAAA records). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: move directory size logic to ceph_getattrSage Weil2009-10-21
| | | | | | | | | | We can't fill i_size with rbytes at the fill_file_size stage without adding additional checks for directories. Notably, we want st_blocks to remain 0 on directories so that 'du' still works. Fill in i_blocks, i_size specially in ceph_getattr instead. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: v0.17 of clientSage Weil2009-10-19
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: include preferred osd in placement seedSage Weil2009-10-19
| | | | | | | | | | Mix the preferred osd (if any) into the placement seed that is fed into the CRUSH object placement calculation. This prevents all the placement pgs from peering with the same osds. Rev the osd client protocol with this change. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: enable readaheadSage Weil2009-10-16
| | | | | | Initialized bdi->ra_pages to enable readahead. Use 512KB default. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: move dirty caps code aroundSage Weil2009-10-15
| | | | | | Cleanup only. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: warn on allocation from msgpool with larger front_lenSage Weil2009-10-15
| | | | | | | | Pass the front_len we need when pulling a message off a msgpool, and WARN if it is greater than the pool's size. Then try to allocate a new message (to continue without failing). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: correct subscribe_ack msgpool payload sizeSage Weil2009-10-15
| | | | | | | Defined a struct for the SUBSCRIBE_ACK, and use that to size the msgpool. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: flush dirty caps via the cap_dirty listSage Weil2009-10-15
| | | | | | | | | | | | | | | | | | Previously we were flushing dirty caps by passing an extra flag when traversing the delayed caps list. Besides being a bit ugly, that can also miss caps that are dirty but didn't result in a cap requeue: notably, mark_caps_dirty(). Separate the flushing into a separate helper, and traverse the cap_dirty list. This also brings i_dirty_item in line with i_dirty_caps: we are on the list IFF caps != 0. We carry an inode ref IFF dirty_caps|flushing_caps != 0. Lose the unused return value from __ceph_mark_caps_dirty(). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: move generic flushing code into helperSage Weil2009-10-14
| | | | | | | Both callers of __mark_caps_flushing() do the same work; move it into the helper. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: initialize sb->s_bdi, bdi_unregister after kill_anon_superSage Weil2009-10-14
| | | | | | | Writeback doesn't work without the bdi set, and writeback on umount doesn't work if we unregister the bdi too early. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: convert encode/decode macros to inlinesSage Weil2009-10-14
| | | | | | | This avoids the fugly pass by reference and makes the code a bit easier to read. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: add version field to message headerSage Weil2009-10-13
| | | | | | | | This makes it easier for individual message types to indicate their particular encoding, and make future changes backward compatible. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove unused CEPH_MSG_{OSD,MDS}_GETMAPSage Weil2009-10-12
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: ignore trailing data in monampSage Weil2009-10-12
| | | | | | This lets us extend the format more easily. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: add file layout validationSage Weil2009-10-09
| | | | | | This tracks updates to code shared with userspace. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: update to mon client protocol v15Sage Weil2009-10-09
| | | | | | | The mon request headers now include session_mon information that must be properly initialized. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: cancel osd requests before resending themSage Weil2009-10-09
| | | | | | | | This ensures we don't submit the same request twice if we are kicking a specific osd (as with an osd_reset), or when we hit a transient error and resend. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: reset osd session on fault, not peer_resetSage Weil2009-10-09
| | | | | | | The peer_reset just takes longer (until we reconnect and discover the osd dropped the session... which it will). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fail gracefully on corrupt osdmap (bad pg_temp mapping)Sage Weil2009-10-09
| | | | | | Return an error and report a corrupt map instead of crying BUG(). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: revoke osd request message on request completionSage Weil2009-10-09
| | | | | | | | | If an osd has failed or returned and a request has been sent twice, it's possible to get a reply and unregister the request while the request message is queued for delivery. Since the message references the caller's page vector, we need to revoke it before completing. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix osd request submission raceSage Weil2009-10-09
| | | | | | | | | | | | The osd request submission path registers the request, drops and retakes the request_mutex, then sends it to the OSD. A racing kick_requests could sent it during that interval, causing the same msg to be sent twice and BUGing in the msgr. Fix by only sending the message if it hasn't been touched by other threads. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: renew mon subscription before it expiresSage Weil2009-10-08
| | | | | | | | Be conservative: renew subscription once half the interval has expired. Do not reuse sub expiration to control hunting. Signed-off-by: Sage Weil <sage@newdream.net>