mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-12 09:06:45 +07:00
498052bba5
* all changes of current->fs are done under task_lock and write_lock of old fs->lock * refcount is not atomic anymore (same protection) * its decrements are done when removing reference from current; at the same time we decide whether to free it. * put_fs_struct() is gone * new field - ->in_exec. Set by check_unsafe_exec() if we are trying to do execve() and only subthreads share fs_struct. Cleared when finishing exec (success and failure alike). Makes CLONE_FS fail with -EAGAIN if set. * check_unsafe_exec() may fail with -EAGAIN if another execve() from subthread is in progress. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
25 lines
598 B
C
25 lines
598 B
C
#ifndef _LINUX_FS_STRUCT_H
|
|
#define _LINUX_FS_STRUCT_H
|
|
|
|
#include <linux/path.h>
|
|
|
|
struct fs_struct {
|
|
int users;
|
|
rwlock_t lock;
|
|
int umask;
|
|
int in_exec;
|
|
struct path root, pwd;
|
|
};
|
|
|
|
extern struct kmem_cache *fs_cachep;
|
|
|
|
extern void exit_fs(struct task_struct *);
|
|
extern void set_fs_root(struct fs_struct *, struct path *);
|
|
extern void set_fs_pwd(struct fs_struct *, struct path *);
|
|
extern struct fs_struct *copy_fs_struct(struct fs_struct *);
|
|
extern void free_fs_struct(struct fs_struct *);
|
|
extern void daemonize_fs_struct(void);
|
|
extern int unshare_fs_struct(void);
|
|
|
|
#endif /* _LINUX_FS_STRUCT_H */
|