aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 05:01:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:31 -0400
commit47237687d73cbeae1dd7a133c3fc3d7239094568 (patch)
tree1d267d03246f0a16cbff3c8221ee69dd1521f835 /fs/ceph
parenta8277b9baa6268de386529a33061775bc716198b (diff)
->atomic_open() prototype change - pass int * instead of bool *
... and let finish_open() report having opened the file via that sucker. Next step: don't modify od->filp at all. [AV: FILE_CREATE was already used by cifs; Miklos' fix folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/dir.c8
-rw-r--r--fs/ceph/file.c5
-rw-r--r--fs/ceph/super.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 75df600ec9b4..81e5e908df9d 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -636,7 +636,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
636 636
637struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry, 637struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry,
638 struct opendata *od, unsigned flags, umode_t mode, 638 struct opendata *od, unsigned flags, umode_t mode,
639 bool *created) 639 int *opened)
640{ 640{
641 int err; 641 int err;
642 struct dentry *res = NULL; 642 struct dentry *res = NULL;
@@ -650,7 +650,7 @@ struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry,
650 if (err < 0) 650 if (err < 0)
651 return ERR_PTR(err); 651 return ERR_PTR(err);
652 652
653 return ceph_lookup_open(dir, dentry, od, flags, mode); 653 return ceph_lookup_open(dir, dentry, od, flags, mode, opened);
654 } 654 }
655 655
656 if (d_unhashed(dentry)) { 656 if (d_unhashed(dentry)) {
@@ -668,8 +668,8 @@ struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry,
668 return NULL; 668 return NULL;
669 } 669 }
670 670
671 *created = true; 671 *opened |= FILE_CREATED;
672 filp = ceph_lookup_open(dir, dentry, od, flags, mode); 672 filp = ceph_lookup_open(dir, dentry, od, flags, mode, opened);
673 dput(res); 673 dput(res);
674 674
675 return filp; 675 return filp;
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index e34dc22e75a9..4c304a90d046 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -214,7 +214,8 @@ out:
214 * ceph_release gets called). So fear not! 214 * ceph_release gets called). So fear not!
215 */ 215 */
216struct file *ceph_lookup_open(struct inode *dir, struct dentry *dentry, 216struct file *ceph_lookup_open(struct inode *dir, struct dentry *dentry,
217 struct opendata *od, unsigned flags, umode_t mode) 217 struct opendata *od, unsigned flags, umode_t mode,
218 int *opened)
218{ 219{
219 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 220 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb);
220 struct ceph_mds_client *mdsc = fsc->mdsc; 221 struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -247,7 +248,7 @@ struct file *ceph_lookup_open(struct inode *dir, struct dentry *dentry,
247 err = ceph_handle_notrace_create(dir, dentry); 248 err = ceph_handle_notrace_create(dir, dentry);
248 if (err) 249 if (err)
249 goto out; 250 goto out;
250 file = finish_open(od, req->r_dentry, ceph_open); 251 file = finish_open(od, req->r_dentry, ceph_open, opened);
251 if (IS_ERR(file)) 252 if (IS_ERR(file))
252 err = PTR_ERR(file); 253 err = PTR_ERR(file);
253out: 254out:
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index e61e54673e56..f9a325108b49 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -808,7 +808,7 @@ extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);
808extern int ceph_open(struct inode *inode, struct file *file); 808extern int ceph_open(struct inode *inode, struct file *file);
809extern struct file *ceph_lookup_open(struct inode *dir, struct dentry *dentry, 809extern struct file *ceph_lookup_open(struct inode *dir, struct dentry *dentry,
810 struct opendata *od, unsigned flags, 810 struct opendata *od, unsigned flags,
811 umode_t mode); 811 umode_t mode, int *opened);
812extern int ceph_release(struct inode *inode, struct file *filp); 812extern int ceph_release(struct inode *inode, struct file *filp);
813 813
814/* dir.c */ 814/* dir.c */