aboutsummaryrefslogtreecommitdiff
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-22 12:39:14 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 16:33:35 +0400
commitd95852777bc8ba6b3ad3397d495c5f9dd8ca8383 (patch)
tree96e9d8b1d33c4f6f7b5ba5be0fa4fd8f77c7a67f /fs/ceph/dir.c
parent3d8a00d2099ebc6d5a6e95fadaf861709d9919a8 (diff)
make ->atomic_open() return int
Change of calling conventions: old new NULL 1 file 0 ERR_PTR(-ve) -ve Caller *knows* that struct file *; no need to return it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 81e5e908df9d..d8bfabeeaa25 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -634,21 +634,20 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
return dentry;
}
-struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry,
- struct opendata *od, unsigned flags, umode_t mode,
- int *opened)
+int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
+ struct opendata *od, unsigned flags, umode_t mode,
+ int *opened)
{
int err;
struct dentry *res = NULL;
- struct file *filp;
if (!(flags & O_CREAT)) {
if (dentry->d_name.len > NAME_MAX)
- return ERR_PTR(-ENAMETOOLONG);
+ return -ENAMETOOLONG;
err = ceph_init_dentry(dentry);
if (err < 0)
- return ERR_PTR(err);
+ return err;
return ceph_lookup_open(dir, dentry, od, flags, mode, opened);
}
@@ -656,7 +655,7 @@ struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry,
if (d_unhashed(dentry)) {
res = ceph_lookup(dir, dentry, NULL);
if (IS_ERR(res))
- return ERR_CAST(res);
+ return PTR_ERR(res);
if (res)
dentry = res;
@@ -665,14 +664,14 @@ struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry,
/* We don't deal with positive dentries here */
if (dentry->d_inode) {
finish_no_open(od, res);
- return NULL;
+ return 1;
}
*opened |= FILE_CREATED;
- filp = ceph_lookup_open(dir, dentry, od, flags, mode, opened);
+ err = ceph_lookup_open(dir, dentry, od, flags, mode, opened);
dput(res);
- return filp;
+ return err;
}
/*