diff options
Diffstat (limited to 'fs/cachefiles/internal.h')
-rw-r--r-- | fs/cachefiles/internal.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h index b2adcb59b4ce..e57ce5ef875c 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h @@ -105,6 +105,26 @@ static inline int cachefiles_inject_remove_error(void) } /* + * security.c + */ +extern int cachefiles_get_security_ID(struct cachefiles_cache *cache); +extern int cachefiles_determine_cache_security(struct cachefiles_cache *cache, + struct dentry *root, + const struct cred **_saved_cred); + +static inline void cachefiles_begin_secure(struct cachefiles_cache *cache, + const struct cred **_saved_cred) +{ + *_saved_cred = override_creds(cache->cache_cred); +} + +static inline void cachefiles_end_secure(struct cachefiles_cache *cache, + const struct cred *saved_cred) +{ + revert_creds(saved_cred); +} + +/* * Error handling */ #define cachefiles_io_error(___cache, FMT, ...) \ |