linux/include/linux/fs_struct.h
<<
>>
Prefs
   1#ifndef _LINUX_FS_STRUCT_H
   2#define _LINUX_FS_STRUCT_H
   3
   4#include <linux/path.h>
   5#include <linux/spinlock.h>
   6#include <linux/seqlock.h>
   7
   8struct fs_struct {
   9        int users;
  10        spinlock_t lock;
  11        seqcount_t seq;
  12        int umask;
  13        int in_exec;
  14        struct path root, pwd;
  15};
  16
  17extern struct kmem_cache *fs_cachep;
  18
  19extern void exit_fs(struct task_struct *);
  20extern void set_fs_root(struct fs_struct *, struct path *);
  21extern void set_fs_pwd(struct fs_struct *, struct path *);
  22extern struct fs_struct *copy_fs_struct(struct fs_struct *);
  23extern void free_fs_struct(struct fs_struct *);
  24extern int unshare_fs_struct(void);
  25
  26static inline void get_fs_root(struct fs_struct *fs, struct path *root)
  27{
  28        spin_lock(&fs->lock);
  29        *root = fs->root;
  30        path_get(root);
  31        spin_unlock(&fs->lock);
  32}
  33
  34static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
  35{
  36        spin_lock(&fs->lock);
  37        *pwd = fs->pwd;
  38        path_get(pwd);
  39        spin_unlock(&fs->lock);
  40}
  41
  42static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
  43                                       struct path *pwd)
  44{
  45        spin_lock(&fs->lock);
  46        *root = fs->root;
  47        path_get(root);
  48        *pwd = fs->pwd;
  49        path_get(pwd);
  50        spin_unlock(&fs->lock);
  51}
  52
  53#endif /* _LINUX_FS_STRUCT_H */
  54
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.