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

don't pass superblock to hypfs_{mkdir,create*}

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

Al Viro a118cfdf e334cf4f

+39 -46
+3 -6
arch/s390/hypfs/hypfs.h
··· 18 18 #define UPDATE_FILE_MODE 0220 19 19 #define DIR_MODE 0550 20 20 21 - extern struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent, 22 - const char *name); 21 + extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name); 23 22 24 - extern struct dentry *hypfs_create_u64(struct super_block *sb, 25 - struct dentry *dir, const char *name, 23 + extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name, 26 24 __u64 value); 27 25 28 - extern struct dentry *hypfs_create_str(struct super_block *sb, 29 - struct dentry *dir, const char *name, 26 + extern struct dentry *hypfs_create_str(struct dentry *dir, const char *name, 30 27 char *string); 31 28 32 29 /* LPAR Hypervisor */
+14 -14
arch/s390/hypfs/hypfs_diag.c
··· 631 631 632 632 snprintf(buffer, TMP_SIZE, "%d", cpu_info__cpu_addr(diag204_info_type, 633 633 cpu_info)); 634 - cpu_dir = hypfs_mkdir(cpus_dir->d_sb, cpus_dir, buffer); 635 - rc = hypfs_create_u64(cpu_dir->d_sb, cpu_dir, "mgmtime", 634 + cpu_dir = hypfs_mkdir(cpus_dir, buffer); 635 + rc = hypfs_create_u64(cpu_dir, "mgmtime", 636 636 cpu_info__acc_time(diag204_info_type, cpu_info) - 637 637 cpu_info__lp_time(diag204_info_type, cpu_info)); 638 638 if (IS_ERR(rc)) 639 639 return PTR_ERR(rc); 640 - rc = hypfs_create_u64(cpu_dir->d_sb, cpu_dir, "cputime", 640 + rc = hypfs_create_u64(cpu_dir, "cputime", 641 641 cpu_info__lp_time(diag204_info_type, cpu_info)); 642 642 if (IS_ERR(rc)) 643 643 return PTR_ERR(rc); 644 644 if (diag204_info_type == INFO_EXT) { 645 - rc = hypfs_create_u64(cpu_dir->d_sb, cpu_dir, "onlinetime", 645 + rc = hypfs_create_u64(cpu_dir, "onlinetime", 646 646 cpu_info__online_time(diag204_info_type, 647 647 cpu_info)); 648 648 if (IS_ERR(rc)) 649 649 return PTR_ERR(rc); 650 650 } 651 651 diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer); 652 - rc = hypfs_create_str(cpu_dir->d_sb, cpu_dir, "type", buffer); 652 + rc = hypfs_create_str(cpu_dir, "type", buffer); 653 653 return PTR_RET(rc); 654 654 } 655 655 ··· 663 663 664 664 part_hdr__part_name(diag204_info_type, part_hdr, lpar_name); 665 665 lpar_name[LPAR_NAME_LEN] = 0; 666 - lpar_dir = hypfs_mkdir(systems_dir->d_sb, systems_dir, lpar_name); 666 + lpar_dir = hypfs_mkdir(systems_dir, lpar_name); 667 667 if (IS_ERR(lpar_dir)) 668 668 return lpar_dir; 669 - cpus_dir = hypfs_mkdir(lpar_dir->d_sb, lpar_dir, "cpus"); 669 + cpus_dir = hypfs_mkdir(lpar_dir, "cpus"); 670 670 if (IS_ERR(cpus_dir)) 671 671 return cpus_dir; 672 672 cpu_info = part_hdr + part_hdr__size(diag204_info_type); ··· 688 688 689 689 snprintf(buffer, TMP_SIZE, "%i", phys_cpu__cpu_addr(diag204_info_type, 690 690 cpu_info)); 691 - cpu_dir = hypfs_mkdir(cpus_dir->d_sb, cpus_dir, buffer); 691 + cpu_dir = hypfs_mkdir(cpus_dir, buffer); 692 692 if (IS_ERR(cpu_dir)) 693 693 return PTR_ERR(cpu_dir); 694 - rc = hypfs_create_u64(cpu_dir->d_sb, cpu_dir, "mgmtime", 694 + rc = hypfs_create_u64(cpu_dir, "mgmtime", 695 695 phys_cpu__mgm_time(diag204_info_type, cpu_info)); 696 696 if (IS_ERR(rc)) 697 697 return PTR_ERR(rc); 698 698 diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer); 699 - rc = hypfs_create_str(cpu_dir->d_sb, cpu_dir, "type", buffer); 699 + rc = hypfs_create_str(cpu_dir, "type", buffer); 700 700 return PTR_RET(rc); 701 701 } 702 702 ··· 706 706 void *cpu_info; 707 707 struct dentry *cpus_dir; 708 708 709 - cpus_dir = hypfs_mkdir(parent_dir->d_sb, parent_dir, "cpus"); 709 + cpus_dir = hypfs_mkdir(parent_dir, "cpus"); 710 710 if (IS_ERR(cpus_dir)) 711 711 return cpus_dir; 712 712 cpu_info = phys_hdr + phys_hdr__size(diag204_info_type); ··· 731 731 if (IS_ERR(buffer)) 732 732 return PTR_ERR(buffer); 733 733 734 - systems_dir = hypfs_mkdir(root->d_sb, root, "systems"); 734 + systems_dir = hypfs_mkdir(root, "systems"); 735 735 if (IS_ERR(systems_dir)) { 736 736 rc = PTR_ERR(systems_dir); 737 737 goto err_out; ··· 752 752 goto err_out; 753 753 } 754 754 } 755 - hyp_dir = hypfs_mkdir(root->d_sb, root, "hyp"); 755 + hyp_dir = hypfs_mkdir(root, "hyp"); 756 756 if (IS_ERR(hyp_dir)) { 757 757 rc = PTR_ERR(hyp_dir); 758 758 goto err_out; 759 759 } 760 - ptr = hypfs_create_str(root->d_sb, hyp_dir, "type", "LPAR Hypervisor"); 760 + ptr = hypfs_create_str(hyp_dir, "type", "LPAR Hypervisor"); 761 761 if (IS_ERR(ptr)) { 762 762 rc = PTR_ERR(ptr); 763 763 goto err_out;
+10 -10
arch/s390/hypfs/hypfs_vm.c
··· 110 110 #define ATTRIBUTE(dir, name, member) \ 111 111 do { \ 112 112 void *rc; \ 113 - rc = hypfs_create_u64(dir->d_sb, dir, name, member); \ 113 + rc = hypfs_create_u64(dir, name, member); \ 114 114 if (IS_ERR(rc)) \ 115 115 return PTR_ERR(rc); \ 116 116 } while(0) ··· 129 129 memcpy(guest_name, data->guest_name, NAME_LEN); 130 130 EBCASC(guest_name, NAME_LEN); 131 131 strim(guest_name); 132 - guest_dir = hypfs_mkdir(systems_dir->d_sb, systems_dir, guest_name); 132 + guest_dir = hypfs_mkdir(systems_dir, guest_name); 133 133 if (IS_ERR(guest_dir)) 134 134 return PTR_ERR(guest_dir); 135 135 ATTRIBUTE(guest_dir, "onlinetime_us", data->el_time); 136 136 137 137 /* logical cpu information */ 138 - cpus_dir = hypfs_mkdir(guest_dir->d_sb, guest_dir, "cpus"); 138 + cpus_dir = hypfs_mkdir(guest_dir, "cpus"); 139 139 if (IS_ERR(cpus_dir)) 140 140 return PTR_ERR(cpus_dir); 141 141 ATTRIBUTE(cpus_dir, "cputime_us", data->used_cpu); ··· 147 147 ATTRIBUTE(cpus_dir, "weight_cur", data->cpu_shares); 148 148 149 149 /* memory information */ 150 - mem_dir = hypfs_mkdir(guest_dir->d_sb, guest_dir, "mem"); 150 + mem_dir = hypfs_mkdir(guest_dir, "mem"); 151 151 if (IS_ERR(mem_dir)) 152 152 return PTR_ERR(mem_dir); 153 153 ATTRIBUTE(mem_dir, "min_KiB", data->mem_min_kb); ··· 156 156 ATTRIBUTE(mem_dir, "share_KiB", data->mem_share_kb); 157 157 158 158 /* samples */ 159 - samples_dir = hypfs_mkdir(guest_dir->d_sb, guest_dir, "samples"); 159 + samples_dir = hypfs_mkdir(guest_dir, "samples"); 160 160 if (IS_ERR(samples_dir)) 161 161 return PTR_ERR(samples_dir); 162 162 ATTRIBUTE(samples_dir, "cpu_using", data->cpu_use_samp); ··· 180 180 return PTR_ERR(data); 181 181 182 182 /* Hpervisor Info */ 183 - dir = hypfs_mkdir(root->d_sb, root, "hyp"); 183 + dir = hypfs_mkdir(root, "hyp"); 184 184 if (IS_ERR(dir)) { 185 185 rc = PTR_ERR(dir); 186 186 goto failed; 187 187 } 188 - file = hypfs_create_str(root->d_sb, dir, "type", "z/VM Hypervisor"); 188 + file = hypfs_create_str(dir, "type", "z/VM Hypervisor"); 189 189 if (IS_ERR(file)) { 190 190 rc = PTR_ERR(file); 191 191 goto failed; 192 192 } 193 193 194 194 /* physical cpus */ 195 - dir = hypfs_mkdir(root->d_sb, root, "cpus"); 195 + dir = hypfs_mkdir(root, "cpus"); 196 196 if (IS_ERR(dir)) { 197 197 rc = PTR_ERR(dir); 198 198 goto failed; 199 199 } 200 - file = hypfs_create_u64(root->d_sb, dir, "count", data->lcpus); 200 + file = hypfs_create_u64(dir, "count", data->lcpus); 201 201 if (IS_ERR(file)) { 202 202 rc = PTR_ERR(file); 203 203 goto failed; 204 204 } 205 205 206 206 /* guests */ 207 - dir = hypfs_mkdir(root->d_sb, root, "systems"); 207 + dir = hypfs_mkdir(root, "systems"); 208 208 if (IS_ERR(dir)) { 209 209 rc = PTR_ERR(dir); 210 210 goto failed;
+12 -16
arch/s390/hypfs/inode.c
··· 28 28 #define HYPFS_MAGIC 0x687970 /* ASCII 'hyp' */ 29 29 #define TMP_SIZE 64 /* size of temporary buffers */ 30 30 31 - static struct dentry *hypfs_create_update_file(struct super_block *sb, 32 - struct dentry *dir); 31 + static struct dentry *hypfs_create_update_file(struct dentry *dir); 33 32 34 33 struct hypfs_sb_info { 35 34 kuid_t uid; /* uid used for files and dirs */ ··· 306 307 rc = hypfs_diag_create_files(root_dentry); 307 308 if (rc) 308 309 return rc; 309 - sbi->update_file = hypfs_create_update_file(sb, root_dentry); 310 + sbi->update_file = hypfs_create_update_file(root_dentry); 310 311 if (IS_ERR(sbi->update_file)) 311 312 return PTR_ERR(sbi->update_file); 312 313 hypfs_update_update(sb); ··· 333 334 kill_litter_super(sb); 334 335 } 335 336 336 - static struct dentry *hypfs_create_file(struct super_block *sb, 337 - struct dentry *parent, const char *name, 337 + static struct dentry *hypfs_create_file(struct dentry *parent, const char *name, 338 338 char *data, umode_t mode) 339 339 { 340 340 struct dentry *dentry; ··· 345 347 dentry = ERR_PTR(-ENOMEM); 346 348 goto fail; 347 349 } 348 - inode = hypfs_make_inode(sb, mode); 350 + inode = hypfs_make_inode(parent->d_sb, mode); 349 351 if (!inode) { 350 352 dput(dentry); 351 353 dentry = ERR_PTR(-ENOMEM); ··· 371 373 return dentry; 372 374 } 373 375 374 - struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent, 375 - const char *name) 376 + struct dentry *hypfs_mkdir(struct dentry *parent, const char *name) 376 377 { 377 378 struct dentry *dentry; 378 379 379 - dentry = hypfs_create_file(sb, parent, name, NULL, S_IFDIR | DIR_MODE); 380 + dentry = hypfs_create_file(parent, name, NULL, S_IFDIR | DIR_MODE); 380 381 if (IS_ERR(dentry)) 381 382 return dentry; 382 383 hypfs_add_dentry(dentry); 383 384 return dentry; 384 385 } 385 386 386 - static struct dentry *hypfs_create_update_file(struct super_block *sb, 387 - struct dentry *dir) 387 + static struct dentry *hypfs_create_update_file(struct dentry *dir) 388 388 { 389 389 struct dentry *dentry; 390 390 391 - dentry = hypfs_create_file(sb, dir, "update", NULL, 391 + dentry = hypfs_create_file(dir, "update", NULL, 392 392 S_IFREG | UPDATE_FILE_MODE); 393 393 /* 394 394 * We do not put the update file on the 'delete' list with ··· 396 400 return dentry; 397 401 } 398 402 399 - struct dentry *hypfs_create_u64(struct super_block *sb, struct dentry *dir, 403 + struct dentry *hypfs_create_u64(struct dentry *dir, 400 404 const char *name, __u64 value) 401 405 { 402 406 char *buffer; ··· 408 412 if (!buffer) 409 413 return ERR_PTR(-ENOMEM); 410 414 dentry = 411 - hypfs_create_file(sb, dir, name, buffer, S_IFREG | REG_FILE_MODE); 415 + hypfs_create_file(dir, name, buffer, S_IFREG | REG_FILE_MODE); 412 416 if (IS_ERR(dentry)) { 413 417 kfree(buffer); 414 418 return ERR_PTR(-ENOMEM); ··· 417 421 return dentry; 418 422 } 419 423 420 - struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir, 424 + struct dentry *hypfs_create_str(struct dentry *dir, 421 425 const char *name, char *string) 422 426 { 423 427 char *buffer; ··· 428 432 return ERR_PTR(-ENOMEM); 429 433 sprintf(buffer, "%s\n", string); 430 434 dentry = 431 - hypfs_create_file(sb, dir, name, buffer, S_IFREG | REG_FILE_MODE); 435 + hypfs_create_file(dir, name, buffer, S_IFREG | REG_FILE_MODE); 432 436 if (IS_ERR(dentry)) { 433 437 kfree(buffer); 434 438 return ERR_PTR(-ENOMEM);