diff options
| -rw-r--r-- | fs/afs/cell.c | 4 | ||||
| -rw-r--r-- | fs/afs/cmservice.c | 2 | ||||
| -rw-r--r-- | fs/afs/internal.h | 43 | ||||
| -rw-r--r-- | fs/afs/main.c | 33 | ||||
| -rw-r--r-- | fs/afs/netdevices.c | 6 | ||||
| -rw-r--r-- | fs/afs/proc.c | 358 | ||||
| -rw-r--r-- | fs/afs/rxrpc.c | 2 | ||||
| -rw-r--r-- | fs/afs/super.c | 20 |
8 files changed, 173 insertions, 295 deletions
diff --git a/fs/afs/cell.c b/fs/afs/cell.c index 80fd127239ce..bb92b54d2a4a 100644 --- a/fs/afs/cell.c +++ b/fs/afs/cell.c | |||
| @@ -528,7 +528,7 @@ static int afs_activate_cell(struct afs_net *net, struct afs_cell *cell) | |||
| 528 | NULL, 0, | 528 | NULL, 0, |
| 529 | cell, 0, true); | 529 | cell, 0, true); |
| 530 | #endif | 530 | #endif |
| 531 | ret = afs_proc_cell_setup(net, cell); | 531 | ret = afs_proc_cell_setup(cell); |
| 532 | if (ret < 0) | 532 | if (ret < 0) |
| 533 | return ret; | 533 | return ret; |
| 534 | spin_lock(&net->proc_cells_lock); | 534 | spin_lock(&net->proc_cells_lock); |
| @@ -544,7 +544,7 @@ static void afs_deactivate_cell(struct afs_net *net, struct afs_cell *cell) | |||
| 544 | { | 544 | { |
| 545 | _enter("%s", cell->name); | 545 | _enter("%s", cell->name); |
| 546 | 546 | ||
| 547 | afs_proc_cell_remove(net, cell); | 547 | afs_proc_cell_remove(cell); |
| 548 | 548 | ||
| 549 | spin_lock(&net->proc_cells_lock); | 549 | spin_lock(&net->proc_cells_lock); |
| 550 | list_del_init(&cell->proc_link); | 550 | list_del_init(&cell->proc_link); |
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c index 357de908df3a..4c89b1f4c02b 100644 --- a/fs/afs/cmservice.c +++ b/fs/afs/cmservice.c | |||
| @@ -550,7 +550,7 @@ static void SRXAFSCB_TellMeAboutYourself(struct work_struct *work) | |||
| 550 | nifs = 0; | 550 | nifs = 0; |
| 551 | ifs = kcalloc(32, sizeof(*ifs), GFP_KERNEL); | 551 | ifs = kcalloc(32, sizeof(*ifs), GFP_KERNEL); |
| 552 | if (ifs) { | 552 | if (ifs) { |
| 553 | nifs = afs_get_ipv4_interfaces(ifs, 32, false); | 553 | nifs = afs_get_ipv4_interfaces(call->net, ifs, 32, false); |
| 554 | if (nifs < 0) { | 554 | if (nifs < 0) { |
| 555 | kfree(ifs); | 555 | kfree(ifs); |
| 556 | ifs = NULL; | 556 | ifs = NULL; |
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 5d922ad148a8..e6cef5702ae2 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #include <linux/backing-dev.h> | 22 | #include <linux/backing-dev.h> |
| 23 | #include <linux/uuid.h> | 23 | #include <linux/uuid.h> |
| 24 | #include <net/net_namespace.h> | 24 | #include <net/net_namespace.h> |
| 25 | #include <net/netns/generic.h> | ||
| 26 | #include <net/sock.h> | ||
| 25 | #include <net/af_rxrpc.h> | 27 | #include <net/af_rxrpc.h> |
| 26 | 28 | ||
| 27 | #include "afs.h" | 29 | #include "afs.h" |
| @@ -40,7 +42,8 @@ struct afs_mount_params { | |||
| 40 | afs_voltype_t type; /* type of volume requested */ | 42 | afs_voltype_t type; /* type of volume requested */ |
| 41 | int volnamesz; /* size of volume name */ | 43 | int volnamesz; /* size of volume name */ |
| 42 | const char *volname; /* name of volume to mount */ | 44 | const char *volname; /* name of volume to mount */ |
| 43 | struct afs_net *net; /* Network namespace in effect */ | 45 | struct net *net_ns; /* Network namespace in effect */ |
| 46 | struct afs_net *net; /* the AFS net namespace stuff */ | ||
| 44 | struct afs_cell *cell; /* cell in which to find volume */ | 47 | struct afs_cell *cell; /* cell in which to find volume */ |
| 45 | struct afs_volume *volume; /* volume record */ | 48 | struct afs_volume *volume; /* volume record */ |
| 46 | struct key *key; /* key to use for secure mounting */ | 49 | struct key *key; /* key to use for secure mounting */ |
| @@ -189,7 +192,7 @@ struct afs_read { | |||
| 189 | * - there's one superblock per volume | 192 | * - there's one superblock per volume |
| 190 | */ | 193 | */ |
| 191 | struct afs_super_info { | 194 | struct afs_super_info { |
| 192 | struct afs_net *net; /* Network namespace */ | 195 | struct net *net_ns; /* Network namespace */ |
| 193 | struct afs_cell *cell; /* The cell in which the volume resides */ | 196 | struct afs_cell *cell; /* The cell in which the volume resides */ |
| 194 | struct afs_volume *volume; /* volume record */ | 197 | struct afs_volume *volume; /* volume record */ |
| 195 | bool dyn_root; /* True if dynamic root */ | 198 | bool dyn_root; /* True if dynamic root */ |
| @@ -210,7 +213,6 @@ struct afs_sysnames { | |||
| 210 | char *subs[AFS_NR_SYSNAME]; | 213 | char *subs[AFS_NR_SYSNAME]; |
| 211 | refcount_t usage; | 214 | refcount_t usage; |
| 212 | unsigned short nr; | 215 | unsigned short nr; |
| 213 | short error; | ||
| 214 | char blank[1]; | 216 | char blank[1]; |
| 215 | }; | 217 | }; |
| 216 | 218 | ||
| @@ -218,6 +220,7 @@ struct afs_sysnames { | |||
| 218 | * AFS network namespace record. | 220 | * AFS network namespace record. |
| 219 | */ | 221 | */ |
| 220 | struct afs_net { | 222 | struct afs_net { |
| 223 | struct net *net; /* Backpointer to the owning net namespace */ | ||
| 221 | struct afs_uuid uuid; | 224 | struct afs_uuid uuid; |
| 222 | bool live; /* F if this namespace is being removed */ | 225 | bool live; /* F if this namespace is being removed */ |
| 223 | 226 | ||
| @@ -280,7 +283,6 @@ struct afs_net { | |||
| 280 | }; | 283 | }; |
| 281 | 284 | ||
| 282 | extern const char afs_init_sysname[]; | 285 | extern const char afs_init_sysname[]; |
| 283 | extern struct afs_net __afs_net;// Dummy AFS network namespace; TODO: replace with real netns | ||
| 284 | 286 | ||
| 285 | enum afs_cell_state { | 287 | enum afs_cell_state { |
| 286 | AFS_CELL_UNSET, | 288 | AFS_CELL_UNSET, |
| @@ -787,34 +789,36 @@ extern int afs_drop_inode(struct inode *); | |||
| 787 | * main.c | 789 | * main.c |
| 788 | */ | 790 | */ |
| 789 | extern struct workqueue_struct *afs_wq; | 791 | extern struct workqueue_struct *afs_wq; |
| 792 | extern int afs_net_id; | ||
| 790 | 793 | ||
| 791 | static inline struct afs_net *afs_d2net(struct dentry *dentry) | 794 | static inline struct afs_net *afs_net(struct net *net) |
| 792 | { | 795 | { |
| 793 | return &__afs_net; | 796 | return net_generic(net, afs_net_id); |
| 794 | } | 797 | } |
| 795 | 798 | ||
| 796 | static inline struct afs_net *afs_i2net(struct inode *inode) | 799 | static inline struct afs_net *afs_sb2net(struct super_block *sb) |
| 797 | { | 800 | { |
| 798 | return &__afs_net; | 801 | return afs_net(AFS_FS_S(sb)->net_ns); |
| 799 | } | 802 | } |
| 800 | 803 | ||
| 801 | static inline struct afs_net *afs_v2net(struct afs_vnode *vnode) | 804 | static inline struct afs_net *afs_d2net(struct dentry *dentry) |
| 802 | { | 805 | { |
| 803 | return &__afs_net; | 806 | return afs_sb2net(dentry->d_sb); |
| 804 | } | 807 | } |
| 805 | 808 | ||
| 806 | static inline struct afs_net *afs_sock2net(struct sock *sk) | 809 | static inline struct afs_net *afs_i2net(struct inode *inode) |
| 807 | { | 810 | { |
| 808 | return &__afs_net; | 811 | return afs_sb2net(inode->i_sb); |
| 809 | } | 812 | } |
| 810 | 813 | ||
| 811 | static inline struct afs_net *afs_get_net(struct afs_net *net) | 814 | static inline struct afs_net *afs_v2net(struct afs_vnode *vnode) |
| 812 | { | 815 | { |
| 813 | return net; | 816 | return afs_i2net(&vnode->vfs_inode); |
| 814 | } | 817 | } |
| 815 | 818 | ||
| 816 | static inline void afs_put_net(struct afs_net *net) | 819 | static inline struct afs_net *afs_sock2net(struct sock *sk) |
| 817 | { | 820 | { |
| 821 | return net_generic(sock_net(sk), afs_net_id); | ||
| 818 | } | 822 | } |
| 819 | 823 | ||
| 820 | static inline void __afs_stat(atomic_t *s) | 824 | static inline void __afs_stat(atomic_t *s) |
| @@ -842,15 +846,16 @@ extern void afs_mntpt_kill_timer(void); | |||
| 842 | /* | 846 | /* |
| 843 | * netdevices.c | 847 | * netdevices.c |
| 844 | */ | 848 | */ |
| 845 | extern int afs_get_ipv4_interfaces(struct afs_interface *, size_t, bool); | 849 | extern int afs_get_ipv4_interfaces(struct afs_net *, struct afs_interface *, |
| 850 | size_t, bool); | ||
| 846 | 851 | ||
| 847 | /* | 852 | /* |
| 848 | * proc.c | 853 | * proc.c |
| 849 | */ | 854 | */ |
| 850 | extern int __net_init afs_proc_init(struct afs_net *); | 855 | extern int __net_init afs_proc_init(struct afs_net *); |
| 851 | extern void __net_exit afs_proc_cleanup(struct afs_net *); | 856 | extern void __net_exit afs_proc_cleanup(struct afs_net *); |
| 852 | extern int afs_proc_cell_setup(struct afs_net *, struct afs_cell *); | 857 | extern int afs_proc_cell_setup(struct afs_cell *); |
| 853 | extern void afs_proc_cell_remove(struct afs_net *, struct afs_cell *); | 858 | extern void afs_proc_cell_remove(struct afs_cell *); |
| 854 | extern void afs_put_sysnames(struct afs_sysnames *); | 859 | extern void afs_put_sysnames(struct afs_sysnames *); |
| 855 | 860 | ||
| 856 | /* | 861 | /* |
| @@ -983,7 +988,7 @@ extern bool afs_annotate_server_list(struct afs_server_list *, struct afs_server | |||
| 983 | * super.c | 988 | * super.c |
| 984 | */ | 989 | */ |
| 985 | extern int __init afs_fs_init(void); | 990 | extern int __init afs_fs_init(void); |
| 986 | extern void __exit afs_fs_exit(void); | 991 | extern void afs_fs_exit(void); |
| 987 | 992 | ||
| 988 | /* | 993 | /* |
| 989 | * vlclient.c | 994 | * vlclient.c |
diff --git a/fs/afs/main.c b/fs/afs/main.c index d7560168b3bf..7d2c1354e2ca 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/completion.h> | 15 | #include <linux/completion.h> |
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/random.h> | 17 | #include <linux/random.h> |
| 18 | #include <linux/proc_fs.h> | ||
| 18 | #define CREATE_TRACE_POINTS | 19 | #define CREATE_TRACE_POINTS |
| 19 | #include "internal.h" | ||
