Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
AFS: Use i_generation not i_version for the vnode uniquifier
AFS: Set s_id in the superblock to the volume name
vfs: Fix data corruption after failed write in __block_write_begin()
afs: afs_fill_page reads too much, or wrong data
VFS: Fix vfsmount overput on simultaneous automount
fix wrong iput on d_inode introduced by e6bc45d65d
Delay struct net freeing while there's a sysfs instance refering to it
afs: fix sget() races, close leak on umount
ubifs: fix sget races
ubifs: split allocation of ubifs_info into a separate function
fix leak in proc_set_super()
This commit is contained in:
commit
8dac6bee32
17 changed files with 211 additions and 214 deletions
|
|
@ -32,15 +32,17 @@ enum kobj_ns_type {
|
|||
|
||||
/*
|
||||
* Callbacks so sysfs can determine namespaces
|
||||
* @current_ns: return calling task's namespace
|
||||
* @grab_current_ns: return a new reference to calling task's namespace
|
||||
* @netlink_ns: return namespace to which a sock belongs (right?)
|
||||
* @initial_ns: return the initial namespace (i.e. init_net_ns)
|
||||
* @drop_ns: drops a reference to namespace
|
||||
*/
|
||||
struct kobj_ns_type_operations {
|
||||
enum kobj_ns_type type;
|
||||
const void *(*current_ns)(void);
|
||||
void *(*grab_current_ns)(void);
|
||||
const void *(*netlink_ns)(struct sock *sk);
|
||||
const void *(*initial_ns)(void);
|
||||
void (*drop_ns)(void *);
|
||||
};
|
||||
|
||||
int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
|
||||
|
|
@ -48,9 +50,9 @@ int kobj_ns_type_registered(enum kobj_ns_type type);
|
|||
const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
|
||||
const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
|
||||
|
||||
const void *kobj_ns_current(enum kobj_ns_type type);
|
||||
void *kobj_ns_grab_current(enum kobj_ns_type type);
|
||||
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
|
||||
const void *kobj_ns_initial(enum kobj_ns_type type);
|
||||
void kobj_ns_exit(enum kobj_ns_type type, const void *ns);
|
||||
void kobj_ns_drop(enum kobj_ns_type type, void *ns);
|
||||
|
||||
#endif /* _LINUX_KOBJECT_NS_H */
|
||||
|
|
|
|||
|
|
@ -177,9 +177,6 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
|
|||
struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
|
||||
void sysfs_put(struct sysfs_dirent *sd);
|
||||
|
||||
/* Called to clear a ns tag when it is no longer valid */
|
||||
void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
|
||||
|
||||
int __must_check sysfs_init(void);
|
||||
|
||||
#else /* CONFIG_SYSFS */
|
||||
|
|
@ -338,10 +335,6 @@ static inline void sysfs_put(struct sysfs_dirent *sd)
|
|||
{
|
||||
}
|
||||
|
||||
static inline void sysfs_exit_ns(int type, const void *tag)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int __must_check sysfs_init(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,11 @@ struct netns_ipvs;
|
|||
#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
|
||||
|
||||
struct net {
|
||||
atomic_t passive; /* To decided when the network
|
||||
* namespace should be freed.
|
||||
*/
|
||||
atomic_t count; /* To decided when the network
|
||||
* namespace should be freed.
|
||||
* namespace should be shut down.
|
||||
*/
|
||||
#ifdef NETNS_REFCNT_DEBUG
|
||||
atomic_t use_count; /* To track references we
|
||||
|
|
@ -154,6 +157,9 @@ int net_eq(const struct net *net1, const struct net *net2)
|
|||
{
|
||||
return net1 == net2;
|
||||
}
|
||||
|
||||
extern void net_drop_ns(void *);
|
||||
|
||||
#else
|
||||
|
||||
static inline struct net *get_net(struct net *net)
|
||||
|
|
@ -175,6 +181,8 @@ int net_eq(const struct net *net1, const struct net *net2)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define net_drop_ns NULL
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue