summaryrefslogtreecommitdiff
path: root/fs/aufs/finfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/finfo.c')
-rw-r--r--fs/aufs/finfo.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c
index 07f6eb32d..e0c16b2f1 100644
--- a/fs/aufs/finfo.c
+++ b/fs/aufs/finfo.c
@@ -8,10 +8,9 @@
#include "aufs.h"
-void au_hfput(struct au_hfile *hf, struct file *file)
+void au_hfput(struct au_hfile *hf, int execed)
{
- /* todo: direct access f_flags */
- if (vfsub_file_flags(file) & __FMODE_EXEC)
+ if (execed)
allow_write_access(hf->hf_file);
fput(hf->hf_file);
hf->hf_file = NULL;
@@ -33,7 +32,7 @@ void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, struct file *val)
hf = fidir->fd_hfile + bindex;
if (hf && hf->hf_file)
- au_hfput(hf, file);
+ au_hfput(hf, vfsub_file_execed(file));
if (val) {
FiMustWriteLock(file);
AuDebugOn(IS_ERR_OR_NULL(file->f_path.dentry));
@@ -90,7 +89,7 @@ int au_fidir_realloc(struct au_finfo *finfo, int nbr)
/* ---------------------------------------------------------------------- */
-void au_finfo_fin(struct file *file)
+void au_finfo_fin(struct file *file, int atonce)
{
struct au_finfo *finfo;
@@ -99,7 +98,10 @@ void au_finfo_fin(struct file *file)
finfo = au_fi(file);
AuDebugOn(finfo->fi_hdir);
AuRwDestroy(&finfo->fi_rwsem);
- au_cache_free_finfo(finfo);
+ if (!atonce)
+ au_cache_dfree_finfo(finfo);
+ else
+ au_cache_free_finfo(finfo);
}
void au_fi_init_once(void *_finfo)