Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260345
b: refs/heads/master
c: 2f90b85
h: refs/heads/master
i:
  260343: 054a34a
v: v3
  • Loading branch information
Sage Weil committed Jul 26, 2011
1 parent 9f0c88e commit c5af32a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 468640e32c7f6bfdaaa011095cc388786755d159
refs/heads/master: 2f90b852e3ae73889d7f6de6ecf429b9b6a6b103
10 changes: 4 additions & 6 deletions trunk/fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,14 @@ static void update_dentry_lease(struct dentry *dentry,
return;

spin_lock(&dentry->d_lock);
dout("update_dentry_lease %p mask %d duration %lu ms ttl %lu\n",
dentry, le16_to_cpu(lease->mask), duration, ttl);
dout("update_dentry_lease %p duration %lu ms ttl %lu\n",
dentry, duration, ttl);

/* make lease_rdcache_gen match directory */
dir = dentry->d_parent->d_inode;
di->lease_shared_gen = ceph_inode(dir)->i_shared_gen;

if (lease->mask == 0)
if (duration == 0)
goto out_unlock;

if (di->lease_gen == session->s_cap_gen &&
Expand Down Expand Up @@ -1022,9 +1022,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,

/* do we have a dn lease? */
have_lease = have_dir_cap ||
(le16_to_cpu(rinfo->dlease->mask) &
CEPH_LOCK_DN);

le32_to_cpu(rinfo->dlease->duration_ms);
if (!have_lease)
dout("fill_trace no dentry lease or dir cap\n");

Expand Down
18 changes: 7 additions & 11 deletions trunk/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,6 @@ static void handle_lease(struct ceph_mds_client *mdsc,
struct ceph_mds_lease *h = msg->front.iov_base;
u32 seq;
struct ceph_vino vino;
int mask;
struct qstr dname;
int release = 0;

Expand All @@ -2725,7 +2724,6 @@ static void handle_lease(struct ceph_mds_client *mdsc,
goto bad;
vino.ino = le64_to_cpu(h->ino);
vino.snap = CEPH_NOSNAP;
mask = le16_to_cpu(h->mask);
seq = le32_to_cpu(h->seq);
dname.name = (void *)h + sizeof(*h) + sizeof(u32);
dname.len = msg->front.iov_len - sizeof(*h) - sizeof(u32);
Expand All @@ -2737,8 +2735,8 @@ static void handle_lease(struct ceph_mds_client *mdsc,

/* lookup inode */
inode = ceph_find_inode(sb, vino);
dout("handle_lease %s, mask %d, ino %llx %p %.*s\n",
ceph_lease_op_name(h->action), mask, vino.ino, inode,
dout("handle_lease %s, ino %llx %p %.*s\n",
ceph_lease_op_name(h->action), vino.ino, inode,
dname.len, dname.name);
if (inode == NULL) {
dout("handle_lease no inode %llx\n", vino.ino);
Expand Down Expand Up @@ -2828,7 +2826,6 @@ void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
return;
lease = msg->front.iov_base;
lease->action = action;
lease->mask = cpu_to_le16(1);
lease->ino = cpu_to_le64(ceph_vino(inode).ino);
lease->first = lease->last = cpu_to_le64(ceph_vino(inode).snap);
lease->seq = cpu_to_le32(seq);
Expand All @@ -2850,15 +2847,14 @@ void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
* Pass @inode always, @dentry is optional.
*/
void ceph_mdsc_lease_release(struct ceph_mds_client *mdsc, struct inode *inode,
struct dentry *dentry, int mask)
struct dentry *dentry)
{
struct ceph_dentry_info *di;
struct ceph_mds_session *session;
u32 seq;

BUG_ON(inode == NULL);
BUG_ON(dentry == NULL);
BUG_ON(mask == 0);

/* is dentry lease valid? */
spin_lock(&dentry->d_lock);
Expand All @@ -2868,8 +2864,8 @@ void ceph_mdsc_lease_release(struct ceph_mds_client *mdsc, struct inode *inode,
di->lease_gen != di->lease_session->s_cap_gen ||
!time_before(jiffies, dentry->d_time)) {
dout("lease_release inode %p dentry %p -- "
"no lease on %d\n",
inode, dentry, mask);
"no lease\n",
inode, dentry);
spin_unlock(&dentry->d_lock);
return;
}
Expand All @@ -2880,8 +2876,8 @@ void ceph_mdsc_lease_release(struct ceph_mds_client *mdsc, struct inode *inode,
__ceph_mdsc_drop_dentry_lease(dentry);
spin_unlock(&dentry->d_lock);

dout("lease_release inode %p dentry %p mask %d to mds%d\n",
inode, dentry, mask, session->s_mds);
dout("lease_release inode %p dentry %p to mds%d\n",
inode, dentry, session->s_mds);
ceph_mdsc_lease_send_msg(session, inode, dentry,
CEPH_MDS_LEASE_RELEASE, seq);
ceph_put_mds_session(session);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ceph/mds_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ extern void ceph_mdsc_sync(struct ceph_mds_client *mdsc);

extern void ceph_mdsc_lease_release(struct ceph_mds_client *mdsc,
struct inode *inode,
struct dentry *dn, int mask);
struct dentry *dn);

extern void ceph_invalidate_dir_request(struct ceph_mds_request *req);

Expand Down

0 comments on commit c5af32a

Please sign in to comment.