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
1010 * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.
1111 * It can block.
1212 */
13−void set_fs_root(struct fs_struct *fs, struct path *path)
13+void set_fs_root(struct fs_struct *fs, const struct path *path)
1414 {
1515 struct path old_root;
1616
@@ -29,7 +29,7 @@ void set_fs_root(struct fs_struct *fs, struct path *path) · 12 unmodified lines
2929 * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
3030 * It can block.
3131 */
32−void set_fs_pwd(struct fs_struct *fs, struct path *path)
32+void set_fs_pwd(struct fs_struct *fs, const struct path *path)
3333 {
3434 struct path old_pwd;
3535
@@ -53,7 +53,7 @@ static inline int replace_path(struct path *p, const struct path *old, const str · 17 unmodified lines
5353 return 1;
5454 }
5555
56−void chroot_fs_refs(struct path *old_root, struct path *new_root)
56+void chroot_fs_refs(const struct path *old_root, const struct path *new_root)
5757 {
5858 struct task_struct *g, *p;
5959 struct fs_struct *fs;
fs/internal.h+1−1
@@ -69,7 +69,7 @@ extern void __mnt_drop_write_file(struct file *); · 68 unmodified lines
6969 /*
7070 * fs_struct.c
7171 */
72−extern void chroot_fs_refs(struct path *, struct path *);
72+extern void chroot_fs_refs(const struct path *, const struct path *);
7373
7474 /*
7575 * file_table.c
fs/namei.c+2−2
@@ -451,7 +451,7 @@ int inode_permission(struct inode *inode, int mask) · 450 unmodified lines
451451 *
452452 * Given a path increment the reference count to the dentry and the vfsmount.
453453 */
454−void path_get(struct path *path)
454+void path_get(const struct path *path)
455455 {
456456 mntget(path->mnt);
457457 dget(path->dentry);
@@ -464,7 +464,7 @@ EXPORT_SYMBOL(path_get); · 6 unmodified lines
464464 *
465465 * Given a path decrement the reference count to the dentry and the vfsmount.
466466 */
467−void path_put(struct path *path)
467+void path_put(const struct path *path)
468468 {
469469 dput(path->dentry);
470470 mntput(path->mnt);
include/linux/fs_struct.h+2−2
@@ -17,8 +17,8 @@ struct fs_struct { · 16 unmodified lines
1717 extern struct kmem_cache *fs_cachep;
1818
1919 extern void exit_fs(struct task_struct *);
20−extern void set_fs_root(struct fs_struct *, struct path *);
21−extern void set_fs_pwd(struct fs_struct *, struct path *);
20+extern void set_fs_root(struct fs_struct *, const struct path *);
21+extern void set_fs_pwd(struct fs_struct *, const struct path *);
2222 extern struct fs_struct *copy_fs_struct(struct fs_struct *);
2323 extern void free_fs_struct(struct fs_struct *);
2424 extern int unshare_fs_struct(void);
include/linux/path.h+2−2
@@ -9,8 +9,8 @@ struct path { · 8 unmodified lines
99 struct dentry *dentry;
1010 };
1111
12−extern void path_get(struct path *);
13−extern void path_put(struct path *);
12+extern void path_get(const struct path *);
13+extern void path_put(const struct path *);
1414
1515 static inline int path_equal(const struct path *path1, const struct path *path2)
1616 {

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