diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2016-12-04 17:33:17 +0000 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 11:02:57 +0100 |
commit | 32a3d848eb91a298334991f1891e12e0362f91db (patch) | |
tree | 693bf24282b44846903e45ff0ac165d8ef76e218 /fs/overlayfs/super.c | |
parent | 9aba652190f8cdced66967c97d6159de0cc8478e (diff) | |
download | lwn-32a3d848eb91a298334991f1891e12e0362f91db.tar.gz lwn-32a3d848eb91a298334991f1891e12e0362f91db.zip |
ovl: clean up kstat usage
FWIW, there's a bit of abuse of struct kstat in overlayfs object
creation paths - for one thing, it ends up with a very small subset
of struct kstat (mode + rdev), for another it also needs link in
case of symlinks and ends up passing it separately.
IMO it would be better to introduce a separate object for that.
In principle, we might even lift that thing into general API and switch
->mkdir()/->mknod()/->symlink() to identical calling conventions. Hell
knows, perhaps ->create() as well...
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r-- | fs/overlayfs/super.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 4bd1e9c7246f..7da36ccda438 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -354,12 +354,9 @@ retry: strlen(OVL_WORKDIR_NAME)); if (!IS_ERR(work)) { - struct kstat stat = { - .mode = S_IFDIR | 0, - }; struct iattr attr = { .ia_valid = ATTR_MODE, - .ia_mode = stat.mode, + .ia_mode = S_IFDIR | 0, }; if (work->d_inode) { @@ -373,7 +370,9 @@ retry: goto retry; } - err = ovl_create_real(dir, work, &stat, NULL, NULL, true); + err = ovl_create_real(dir, work, + &(struct cattr){.mode = S_IFDIR | 0}, + NULL, true); if (err) goto out_dput; |