Skip to content

Commit b452a45

Browse files
author
Al Viro
committed
getting rid of 'opened' argument of ->atomic_open() - part 2
__gfs2_lookup(), gfs2_create_inode(), nfs_finish_open() and fuse_create_open() don't need 'opened' anymore. Get rid of that argument in those. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent be12af3 commit b452a45

3 files changed

Lines changed: 13 additions & 15 deletions

File tree

‎fs/fuse/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
399399
*/
400400
static int fuse_create_open(struct inode *dir, struct dentry *entry,
401401
struct file *file, unsigned flags,
402-
umode_t mode, int *opened)
402+
umode_t mode)
403403
{
404404
int err;
405405
struct inode *inode;
@@ -513,7 +513,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
513513
if (fc->no_create)
514514
goto mknod;
515515

516-
err = fuse_create_open(dir, entry, file, flags, mode, opened);
516+
err = fuse_create_open(dir, entry, file, flags, mode);
517517
if (err == -ENOSYS) {
518518
fc->no_create = 1;
519519
goto mknod;

‎fs/gfs2/inode.c‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static int gfs2_initxattrs(struct inode *inode, const struct xattr *xattr_array,
580580
static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
581581
struct file *file,
582582
umode_t mode, dev_t dev, const char *symname,
583-
unsigned int size, int excl, int *opened)
583+
unsigned int size, int excl)
584584
{
585585
const struct qstr *name = &dentry->d_name;
586586
struct posix_acl *default_acl, *acl;
@@ -822,22 +822,21 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
822822
static int gfs2_create(struct inode *dir, struct dentry *dentry,
823823
umode_t mode, bool excl)
824824
{
825-
return gfs2_create_inode(dir, dentry, NULL, S_IFREG | mode, 0, NULL, 0, excl, NULL);
825+
return gfs2_create_inode(dir, dentry, NULL, S_IFREG | mode, 0, NULL, 0, excl);
826826
}
827827

828828
/**
829829
* __gfs2_lookup - Look up a filename in a directory and return its inode
830830
* @dir: The directory inode
831831
* @dentry: The dentry of the new inode
832832
* @file: File to be opened
833-
* @opened: atomic_open flags
834833
*
835834
*
836835
* Returns: errno
837836
*/
838837

839838
static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
840-
struct file *file, int *opened)
839+
struct file *file)
841840
{
842841
struct inode *inode;
843842
struct dentry *d;
@@ -879,7 +878,7 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
879878
static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry,
880879
unsigned flags)
881880
{
882-
return __gfs2_lookup(dir, dentry, NULL, NULL);
881+
return __gfs2_lookup(dir, dentry, NULL);
883882
}
884883

885884
/**
@@ -1189,7 +1188,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
11891188
if (size >= gfs2_max_stuffed_size(GFS2_I(dir)))
11901189
return -ENAMETOOLONG;
11911190

1192-
return gfs2_create_inode(dir, dentry, NULL, S_IFLNK | S_IRWXUGO, 0, symname, size, 0, NULL);
1191+
return gfs2_create_inode(dir, dentry, NULL, S_IFLNK | S_IRWXUGO, 0, symname, size, 0);
11931192
}
11941193

11951194
/**
@@ -1204,7 +1203,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
12041203
static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
12051204
{
12061205
unsigned dsize = gfs2_max_stuffed_size(GFS2_I(dir));
1207-
return gfs2_create_inode(dir, dentry, NULL, S_IFDIR | mode, 0, NULL, dsize, 0, NULL);
1206+
return gfs2_create_inode(dir, dentry, NULL, S_IFDIR | mode, 0, NULL, dsize, 0);
12081207
}
12091208

12101209
/**
@@ -1219,7 +1218,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
12191218
static int gfs2_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
12201219
dev_t dev)
12211220
{
1222-
return gfs2_create_inode(dir, dentry, NULL, mode, dev, NULL, 0, 0, NULL);
1221+
return gfs2_create_inode(dir, dentry, NULL, mode, dev, NULL, 0, 0);
12231222
}
12241223

12251224
/**
@@ -1244,7 +1243,7 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
12441243
if (!d_in_lookup(dentry))
12451244
goto skip_lookup;
12461245

1247-
d = __gfs2_lookup(dir, dentry, file, opened);
1246+
d = __gfs2_lookup(dir, dentry, file);
12481247
if (IS_ERR(d))
12491248
return PTR_ERR(d);
12501249
if (d != NULL)
@@ -1262,7 +1261,7 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
12621261
if (!(flags & O_CREAT))
12631262
return -ENOENT;
12641263

1265-
return gfs2_create_inode(dir, dentry, file, S_IFREG | mode, 0, NULL, 0, excl, opened);
1264+
return gfs2_create_inode(dir, dentry, file, S_IFREG | mode, 0, NULL, 0, excl);
12661265
}
12671266

12681267
/*

‎fs/nfs/dir.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,8 +1434,7 @@ static int do_open(struct inode *inode, struct file *filp)
14341434

14351435
static int nfs_finish_open(struct nfs_open_context *ctx,
14361436
struct dentry *dentry,
1437-
struct file *file, unsigned open_flags,
1438-
int *opened)
1437+
struct file *file, unsigned open_flags)
14391438
{
14401439
int err;
14411440

@@ -1549,7 +1548,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
15491548
goto out;
15501549
}
15511550

1552-
err = nfs_finish_open(ctx, ctx->dentry, file, open_flags, opened);
1551+
err = nfs_finish_open(ctx, ctx->dentry, file, open_flags);
15531552
trace_nfs_atomic_open_exit(dir, ctx, open_flags, err);
15541553
put_nfs_open_context(ctx);
15551554
out:

0 commit comments

Comments
 (0)