/*
* Add a capability under the given MDS session.
*
- * Caller should hold session snap_rwsem (read), s_mutex.
+ * Caller should hold session snap_rwsem (read) and s_mutex.
*
- * @fmode is the open file mode, if we are opening a file,
- * otherwise it is < 0. (This is so we can atomically add
- * the cap and add an open file reference to it.)
+ * @fmode is the open file mode, if we are opening a file, otherwise
+ * it is < 0. (This is so we can atomically add the cap and add an
+ * open file reference to it.)
*/
int ceph_add_cap(struct inode *inode,
struct ceph_mds_session *session, u64 cap_id,
/*
* If we are opening the file, include file mode wanted bits
- * in wanted. Needed by adjust_cap_rdcaps_listing.
+ * in wanted.
*/
if (fmode >= 0)
wanted |= ceph_caps_for_mode(fmode);
}
if (!ci->i_snap_realm) {
+ /*
+ * add this inode to the appropriate snap realm
+ */
struct ceph_snap_realm *realm = ceph_lookup_snap_realm(mdsc,
realmino);
if (realm) {
}
/*
- * Return true if we hold the given mask. And move the cap(s) to the
+ * Check if we hold the given mask. If so, move the cap(s) to the
* front of their respective LRUs. (This is the preferred way for
* callers to check for caps they want.)
*/
}
/*
- * Wait for caps, and take cap references.
+ * Wait for caps, and take cap references. If we can't get a WR cap
+ * due to a small max_size, make sure we check_max_size (and possibly
+ * ask the mds) so we don't get hung up indefinitely.
*/
int ceph_get_caps(struct ceph_inode_info *ci, int need, int want, int *got,
loff_t endoff)
/*
* Handle FLUSH_ACK from MDS, indicating that metadata we sent to the
- * MDS has been safely recorded.
+ * MDS has been safely committed.
*/
static void handle_cap_flush_ack(struct inode *inode,
struct ceph_mds_caps *m,