diff options
author | Tony Lindgren <tony@atomide.com> | 2011-03-10 21:54:14 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-03-10 21:54:14 -0500 |
commit | 94a06b74e724caabcf0464c81527cfbcae0c8aff (patch) | |
tree | 3570b6a627382a5eb5c8328b4959f615544d8e62 /fs/ceph/dir.c | |
parent | 0dde52a9f5330eec240660191a94b51bd911ffcd (diff) | |
parent | 9062511097683b4422f023d181b4a8b2db1a7a72 (diff) |
Merge branch 'for_2.6.39/pm-misc' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r-- | fs/ceph/dir.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index f0aef787a102..099a58615b90 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -60,7 +60,6 @@ int ceph_init_dentry(struct dentry *dentry) | |||
60 | } | 60 | } |
61 | di->dentry = dentry; | 61 | di->dentry = dentry; |
62 | di->lease_session = NULL; | 62 | di->lease_session = NULL; |
63 | di->parent_inode = igrab(dentry->d_parent->d_inode); | ||
64 | dentry->d_fsdata = di; | 63 | dentry->d_fsdata = di; |
65 | dentry->d_time = jiffies; | 64 | dentry->d_time = jiffies; |
66 | ceph_dentry_lru_add(dentry); | 65 | ceph_dentry_lru_add(dentry); |
@@ -410,7 +409,7 @@ more: | |||
410 | spin_lock(&inode->i_lock); | 409 | spin_lock(&inode->i_lock); |
411 | if (ci->i_release_count == fi->dir_release_count) { | 410 | if (ci->i_release_count == fi->dir_release_count) { |
412 | dout(" marking %p complete\n", inode); | 411 | dout(" marking %p complete\n", inode); |
413 | ci->i_ceph_flags |= CEPH_I_COMPLETE; | 412 | /* ci->i_ceph_flags |= CEPH_I_COMPLETE; */ |
414 | ci->i_max_offset = filp->f_pos; | 413 | ci->i_max_offset = filp->f_pos; |
415 | } | 414 | } |
416 | spin_unlock(&inode->i_lock); | 415 | spin_unlock(&inode->i_lock); |
@@ -497,6 +496,7 @@ struct dentry *ceph_finish_lookup(struct ceph_mds_request *req, | |||
497 | 496 | ||
498 | /* .snap dir? */ | 497 | /* .snap dir? */ |
499 | if (err == -ENOENT && | 498 | if (err == -ENOENT && |
499 | ceph_snap(parent) == CEPH_NOSNAP && | ||
500 | strcmp(dentry->d_name.name, | 500 | strcmp(dentry->d_name.name, |
501 | fsc->mount_options->snapdir_name) == 0) { | 501 | fsc->mount_options->snapdir_name) == 0) { |
502 | struct inode *inode = ceph_get_snapdir(parent); | 502 | struct inode *inode = ceph_get_snapdir(parent); |
@@ -1030,28 +1030,8 @@ out_touch: | |||
1030 | static void ceph_dentry_release(struct dentry *dentry) | 1030 | static void ceph_dentry_release(struct dentry *dentry) |
1031 | { | 1031 | { |
1032 | struct ceph_dentry_info *di = ceph_dentry(dentry); | 1032 | struct ceph_dentry_info *di = ceph_dentry(dentry); |
1033 | struct inode *parent_inode = NULL; | ||
1034 | u64 snapid = CEPH_NOSNAP; | ||
1035 | 1033 | ||
1036 | if (!IS_ROOT(dentry)) { | 1034 | dout("dentry_release %p\n", dentry); |
1037 | parent_inode = di->parent_inode; | ||
1038 | if (parent_inode) | ||
1039 | snapid = ceph_snap(parent_inode); | ||
1040 | } | ||
1041 | dout("dentry_release %p parent %p\n", dentry, parent_inode); | ||
1042 | if (parent_inode && snapid != CEPH_SNAPDIR) { | ||
1043 | struct ceph_inode_info *ci = ceph_inode(parent_inode); | ||
1044 | |||
1045 | spin_lock(&parent_inode->i_lock); | ||
1046 | if (ci->i_shared_gen == di->lease_shared_gen || | ||
1047 | snapid <= CEPH_MAXSNAP) { | ||
1048 | dout(" clearing %p complete (d_release)\n", | ||
1049 | parent_inode); | ||
1050 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; | ||
1051 | ci->i_release_count++; | ||
1052 | } | ||
1053 | spin_unlock(&parent_inode->i_lock); | ||
1054 | } | ||
1055 | if (di) { | 1035 | if (di) { |
1056 | ceph_dentry_lru_del(dentry); | 1036 | ceph_dentry_lru_del(dentry); |
1057 | if (di->lease_session) | 1037 | if (di->lease_session) |
@@ -1059,8 +1039,6 @@ static void ceph_dentry_release(struct dentry *dentry) | |||
1059 | kmem_cache_free(ceph_dentry_cachep, di); | 1039 | kmem_cache_free(ceph_dentry_cachep, di); |
1060 | dentry->d_fsdata = NULL; | 1040 | dentry->d_fsdata = NULL; |
1061 | } | 1041 | } |
1062 | if (parent_inode) | ||
1063 | iput(parent_inode); | ||
1064 | } | 1042 | } |
1065 | 1043 | ||
1066 | static int ceph_snapdir_d_revalidate(struct dentry *dentry, | 1044 | static int ceph_snapdir_d_revalidate(struct dentry *dentry, |