Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kill kernfs_pin_sb()

unused now and impossible to use safely anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 6d7fbce7 35ac1184

-31
-30
fs/kernfs/mount.c
··· 377 377 kfree(info); 378 378 } 379 379 380 - /** 381 - * kernfs_pin_sb: try to pin the superblock associated with a kernfs_root 382 - * @kernfs_root: the kernfs_root in question 383 - * @ns: the namespace tag 384 - * 385 - * Pin the superblock so the superblock won't be destroyed in subsequent 386 - * operations. This can be used to block ->kill_sb() which may be useful 387 - * for kernfs users which dynamically manage superblocks. 388 - * 389 - * Returns NULL if there's no superblock associated to this kernfs_root, or 390 - * -EINVAL if the superblock is being freed. 391 - */ 392 - struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns) 393 - { 394 - struct kernfs_super_info *info; 395 - struct super_block *sb = NULL; 396 - 397 - mutex_lock(&kernfs_mutex); 398 - list_for_each_entry(info, &root->supers, node) { 399 - if (info->ns == ns) { 400 - sb = info->sb; 401 - if (!atomic_inc_not_zero(&info->sb->s_active)) 402 - sb = ERR_PTR(-EINVAL); 403 - break; 404 - } 405 - } 406 - mutex_unlock(&kernfs_mutex); 407 - return sb; 408 - } 409 - 410 380 void __init kernfs_init(void) 411 381 { 412 382
-1
include/linux/kernfs.h
··· 357 357 struct kernfs_root *root, unsigned long magic, 358 358 bool *new_sb_created, const void *ns); 359 359 void kernfs_kill_sb(struct super_block *sb); 360 - struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns); 361 360 362 361 void kernfs_init(void); 363 362