History

constify path_get/path_put and fs_struct.c stuff

Al Viro committed 13 years ago

Commit dcf787f1 parent 26567cd5 files · +10 −10Browse files

Unified · Split

5 files
  1. fs/fs_struct.c +3 −3
  2. fs/internal.h +1 −1
  3. fs/namei.c +2 −2
  4. include/linux/fs_struct.h +2 −2
  5. include/linux/path.h +2 −2
fs/fs_struct.c+3−3
@@ -10,7 +10,7 @@ · 9 unmodified lines
10 * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.10 * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.
11 * It can block.11 * It can block.
12 */12 */
13void set_fs_root(struct fs_struct *fs, struct path *path)13void set_fs_root(struct fs_struct *fs, const struct path *path)
14{14{
15 struct path old_root;15 struct path old_root;
16 16
@@ -29,7 +29,7 @@ void set_fs_root(struct fs_struct *fs, struct path *path) · 12 unmodified lines
29 * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.29 * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
30 * It can block.30 * It can block.
31 */31 */
32void set_fs_pwd(struct fs_struct *fs, struct path *path)32void set_fs_pwd(struct fs_struct *fs, const struct path *path)
33{33{
34 struct path old_pwd;34 struct path old_pwd;
35 35
@@ -53,7 +53,7 @@ static inline int replace_path(struct path *p, const struct path *old, const str · 17 unmodified lines
53 return 1;53 return 1;
54}54}
55 55
56void chroot_fs_refs(struct path *old_root, struct path *new_root)56void chroot_fs_refs(const struct path *old_root, const struct path *new_root)
57{57{
58 struct task_struct *g, *p;58 struct task_struct *g, *p;
59 struct fs_struct *fs;59 struct fs_struct *fs;
fs/internal.h+1−1
@@ -69,7 +69,7 @@ extern void __mnt_drop_write_file(struct file *); · 68 unmodified lines
69/*69/*
70 * fs_struct.c70 * fs_struct.c
71 */71 */
72extern void chroot_fs_refs(struct path *, struct path *);72extern void chroot_fs_refs(const struct path *, const struct path *);
73 73
74/*74/*
75 * file_table.c75 * file_table.c
fs/namei.c+2−2
@@ -451,7 +451,7 @@ int inode_permission(struct inode *inode, int mask) · 450 unmodified lines
451 *451 *
452 * Given a path increment the reference count to the dentry and the vfsmount.452 * Given a path increment the reference count to the dentry and the vfsmount.
453 */453 */
454void path_get(struct path *path)454void path_get(const struct path *path)
455{455{
456 mntget(path->mnt);456 mntget(path->mnt);
457 dget(path->dentry);457 dget(path->dentry);
@@ -464,7 +464,7 @@ EXPORT_SYMBOL(path_get); · 6 unmodified lines
464 *464 *
465 * Given a path decrement the reference count to the dentry and the vfsmount.465 * Given a path decrement the reference count to the dentry and the vfsmount.
466 */466 */
467void path_put(struct path *path)467void path_put(const struct path *path)
468{468{
469 dput(path->dentry);469 dput(path->dentry);
470 mntput(path->mnt);470 mntput(path->mnt);
include/linux/fs_struct.h+2−2
@@ -17,8 +17,8 @@ struct fs_struct { · 16 unmodified lines
17extern struct kmem_cache *fs_cachep;17extern struct kmem_cache *fs_cachep;
18 18
19extern void exit_fs(struct task_struct *);19extern void exit_fs(struct task_struct *);
20extern void set_fs_root(struct fs_struct *, struct path *);20extern void set_fs_root(struct fs_struct *, const struct path *);
21extern void set_fs_pwd(struct fs_struct *, struct path *);21extern void set_fs_pwd(struct fs_struct *, const struct path *);
22extern struct fs_struct *copy_fs_struct(struct fs_struct *);22extern struct fs_struct *copy_fs_struct(struct fs_struct *);
23extern void free_fs_struct(struct fs_struct *);23extern void free_fs_struct(struct fs_struct *);
24extern int unshare_fs_struct(void);24extern int unshare_fs_struct(void);
include/linux/path.h+2−2
@@ -9,8 +9,8 @@ struct path { · 8 unmodified lines
9 struct dentry *dentry;9 struct dentry *dentry;
10};10};
11 11
12extern void path_get(struct path *);12extern void path_get(const struct path *);
13extern void path_put(struct path *);13extern void path_put(const struct path *);
14 14
15static inline int path_equal(const struct path *path1, const struct path *path2)15static inline int path_equal(const struct path *path1, const struct path *path2)
16{16{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t