namespace.c (b22364c8eec89e6b0c081a237f3b6348df87796f) | namespace.c (c376222960ae91d5ffb9197ee36771aaed1d9f90) |
---|---|
1/* 2 * linux/fs/namespace.c 3 * 4 * (C) Copyright Al Viro 2000, 2001 5 * Released under GPL v2. 6 * 7 * Based on code from fs/super.c, copyright Linus Torvalds and others. 8 * Heavily rewritten. --- 39 unchanged lines hidden (view full) --- 48 unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES); 49 tmp += ((unsigned long)dentry / L1_CACHE_BYTES); 50 tmp = tmp + (tmp >> hash_bits); 51 return tmp & hash_mask; 52} 53 54struct vfsmount *alloc_vfsmnt(const char *name) 55{ | 1/* 2 * linux/fs/namespace.c 3 * 4 * (C) Copyright Al Viro 2000, 2001 5 * Released under GPL v2. 6 * 7 * Based on code from fs/super.c, copyright Linus Torvalds and others. 8 * Heavily rewritten. --- 39 unchanged lines hidden (view full) --- 48 unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES); 49 tmp += ((unsigned long)dentry / L1_CACHE_BYTES); 50 tmp = tmp + (tmp >> hash_bits); 51 return tmp & hash_mask; 52} 53 54struct vfsmount *alloc_vfsmnt(const char *name) 55{ |
56 struct vfsmount *mnt = kmem_cache_alloc(mnt_cache, GFP_KERNEL); | 56 struct vfsmount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); |
57 if (mnt) { | 57 if (mnt) { |
58 memset(mnt, 0, sizeof(struct vfsmount)); | |
59 atomic_set(&mnt->mnt_count, 1); 60 INIT_LIST_HEAD(&mnt->mnt_hash); 61 INIT_LIST_HEAD(&mnt->mnt_child); 62 INIT_LIST_HEAD(&mnt->mnt_mounts); 63 INIT_LIST_HEAD(&mnt->mnt_list); 64 INIT_LIST_HEAD(&mnt->mnt_expire); 65 INIT_LIST_HEAD(&mnt->mnt_share); 66 INIT_LIST_HEAD(&mnt->mnt_slave_list); --- 1814 unchanged lines hidden --- | 58 atomic_set(&mnt->mnt_count, 1); 59 INIT_LIST_HEAD(&mnt->mnt_hash); 60 INIT_LIST_HEAD(&mnt->mnt_child); 61 INIT_LIST_HEAD(&mnt->mnt_mounts); 62 INIT_LIST_HEAD(&mnt->mnt_list); 63 INIT_LIST_HEAD(&mnt->mnt_expire); 64 INIT_LIST_HEAD(&mnt->mnt_share); 65 INIT_LIST_HEAD(&mnt->mnt_slave_list); --- 1814 unchanged lines hidden --- |