Loading Documentation/filesystems/Locking +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ ata *); int (*removexattr) (struct dentry *, const char *); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); void (*update_time)(struct inode *, struct timespec *, int); struct file * (*atomic_open)(struct inode *, struct dentry *, int (*atomic_open)(struct inode *, struct dentry *, struct opendata *, unsigned open_flag, umode_t create_mode, int *opened); Loading Documentation/filesystems/vfs.txt +3 −3 Original line number Diff line number Diff line Loading @@ -364,7 +364,7 @@ struct inode_operations { ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*removexattr) (struct dentry *, const char *); void (*update_time)(struct inode *, struct timespec *, int); struct file * (*atomic_open)(struct inode *, struct dentry *, int (*atomic_open)(struct inode *, struct dentry *, struct opendata *, unsigned open_flag, umode_t create_mode, int *opened); }; Loading Loading @@ -482,8 +482,8 @@ otherwise noted. atomic_open: called on the last component of an open. Using this optional method the filesystem can look up, possibly create and open the file in one atomic operation. If it cannot perform this (e.g. the file type turned out to be wrong) it may signal this by returning NULL instead of an open struct file pointer. This method is only called if the last turned out to be wrong) it may signal this by returning 1 instead of usual 0 or -ve . This method is only called if the last component is negative or needs lookup. Cached positive dentries are still handled by f_op->open(). Loading fs/9p/vfs_inode.c +4 −6 Original line number Diff line number Diff line Loading @@ -856,7 +856,7 @@ error: return ERR_PTR(result); } static struct file * static int v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, struct opendata *od, unsigned flags, umode_t mode, int *opened) Loading @@ -872,7 +872,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, if (d_unhashed(dentry)) { res = v9fs_vfs_lookup(dir, dentry, NULL); if (IS_ERR(res)) return ERR_CAST(res); return PTR_ERR(res); if (res) dentry = res; Loading @@ -881,7 +881,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, /* Only creates */ if (!(flags & O_CREAT) || dentry->d_inode) { finish_no_open(od, res); return NULL; return 1; } err = 0; Loading Loading @@ -933,13 +933,11 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, *opened |= FILE_CREATED; out: dput(res); return filp; return err; error: if (fid) p9_client_clunk(fid); filp = ERR_PTR(err); goto out; } Loading fs/9p/vfs_inode_dotl.c +6 −8 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, return v9fs_vfs_mknod_dotl(dir, dentry, omode, 0); } static struct file * static int v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, struct opendata *od, unsigned flags, umode_t omode, int *opened) Loading @@ -262,7 +262,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, if (d_unhashed(dentry)) { res = v9fs_vfs_lookup(dir, dentry, NULL); if (IS_ERR(res)) return ERR_CAST(res); return PTR_ERR(res); if (res) dentry = res; Loading @@ -271,7 +271,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, /* Only creates */ if (!(flags & O_CREAT) || dentry->d_inode) { finish_no_open(od, res); return NULL; return 1; } v9ses = v9fs_inode2v9ses(dir); Loading @@ -284,7 +284,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, if (IS_ERR(dfid)) { err = PTR_ERR(dfid); p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err); goto err_return; goto out; } /* clone a fid to use for creation */ Loading @@ -292,7 +292,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, if (IS_ERR(ofid)) { err = PTR_ERR(ofid); p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); goto err_return; goto out; } gid = v9fs_get_fsgid_for_create(dir); Loading Loading @@ -370,7 +370,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, *opened |= FILE_CREATED; out: dput(res); return filp; return err; error: if (fid) Loading @@ -379,8 +379,6 @@ err_clunk_old_fid: if (ofid) p9_client_clunk(ofid); v9fs_set_create_acl(NULL, &dacl, &pacl); err_return: filp = ERR_PTR(err); goto out; } Loading fs/ceph/dir.c +9 −10 Original line number Diff line number Diff line Loading @@ -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, 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); } Loading @@ -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; Loading @@ -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; } /* Loading Loading
Documentation/filesystems/Locking +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ ata *); int (*removexattr) (struct dentry *, const char *); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); void (*update_time)(struct inode *, struct timespec *, int); struct file * (*atomic_open)(struct inode *, struct dentry *, int (*atomic_open)(struct inode *, struct dentry *, struct opendata *, unsigned open_flag, umode_t create_mode, int *opened); Loading
Documentation/filesystems/vfs.txt +3 −3 Original line number Diff line number Diff line Loading @@ -364,7 +364,7 @@ struct inode_operations { ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*removexattr) (struct dentry *, const char *); void (*update_time)(struct inode *, struct timespec *, int); struct file * (*atomic_open)(struct inode *, struct dentry *, int (*atomic_open)(struct inode *, struct dentry *, struct opendata *, unsigned open_flag, umode_t create_mode, int *opened); }; Loading Loading @@ -482,8 +482,8 @@ otherwise noted. atomic_open: called on the last component of an open. Using this optional method the filesystem can look up, possibly create and open the file in one atomic operation. If it cannot perform this (e.g. the file type turned out to be wrong) it may signal this by returning NULL instead of an open struct file pointer. This method is only called if the last turned out to be wrong) it may signal this by returning 1 instead of usual 0 or -ve . This method is only called if the last component is negative or needs lookup. Cached positive dentries are still handled by f_op->open(). Loading
fs/9p/vfs_inode.c +4 −6 Original line number Diff line number Diff line Loading @@ -856,7 +856,7 @@ error: return ERR_PTR(result); } static struct file * static int v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, struct opendata *od, unsigned flags, umode_t mode, int *opened) Loading @@ -872,7 +872,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, if (d_unhashed(dentry)) { res = v9fs_vfs_lookup(dir, dentry, NULL); if (IS_ERR(res)) return ERR_CAST(res); return PTR_ERR(res); if (res) dentry = res; Loading @@ -881,7 +881,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, /* Only creates */ if (!(flags & O_CREAT) || dentry->d_inode) { finish_no_open(od, res); return NULL; return 1; } err = 0; Loading Loading @@ -933,13 +933,11 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, *opened |= FILE_CREATED; out: dput(res); return filp; return err; error: if (fid) p9_client_clunk(fid); filp = ERR_PTR(err); goto out; } Loading
fs/9p/vfs_inode_dotl.c +6 −8 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, return v9fs_vfs_mknod_dotl(dir, dentry, omode, 0); } static struct file * static int v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, struct opendata *od, unsigned flags, umode_t omode, int *opened) Loading @@ -262,7 +262,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, if (d_unhashed(dentry)) { res = v9fs_vfs_lookup(dir, dentry, NULL); if (IS_ERR(res)) return ERR_CAST(res); return PTR_ERR(res); if (res) dentry = res; Loading @@ -271,7 +271,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, /* Only creates */ if (!(flags & O_CREAT) || dentry->d_inode) { finish_no_open(od, res); return NULL; return 1; } v9ses = v9fs_inode2v9ses(dir); Loading @@ -284,7 +284,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, if (IS_ERR(dfid)) { err = PTR_ERR(dfid); p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err); goto err_return; goto out; } /* clone a fid to use for creation */ Loading @@ -292,7 +292,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, if (IS_ERR(ofid)) { err = PTR_ERR(ofid); p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); goto err_return; goto out; } gid = v9fs_get_fsgid_for_create(dir); Loading Loading @@ -370,7 +370,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, *opened |= FILE_CREATED; out: dput(res); return filp; return err; error: if (fid) Loading @@ -379,8 +379,6 @@ err_clunk_old_fid: if (ofid) p9_client_clunk(ofid); v9fs_set_create_acl(NULL, &dacl, &pacl); err_return: filp = ERR_PTR(err); goto out; } Loading
fs/ceph/dir.c +9 −10 Original line number Diff line number Diff line Loading @@ -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, 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); } Loading @@ -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; Loading @@ -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; } /* Loading