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

exofs: Convert to separately allocated bdi

Allocate struct backing_dev_info separately instead of embedding it
inside the superblock. This unifies handling of bdi among users.

CC: Boaz Harrosh <ooo@electrozaur.com>
CC: Benny Halevy <bhalevy@primarydata.com>
Acked-by: Boaz Harrosh <ooo@electrozaur.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>

authored by

Jan Kara and committed by
Jens Axboe
c7f01477 a5695a79

+6 -12
-1
fs/exofs/exofs.h
··· 64 64 * our extension to the in-memory superblock 65 65 */ 66 66 struct exofs_sb_info { 67 - struct backing_dev_info bdi; /* register our bdi with VFS */ 68 67 struct exofs_sb_stats s_ess; /* Written often, pre-allocate*/ 69 68 int s_timeout; /* timeout for OSD operations */ 70 69 uint64_t s_nextid; /* highest object ID used */
+6 -11
fs/exofs/super.c
··· 464 464 sbi->one_comp.obj.partition); 465 465 466 466 exofs_sysfs_sb_del(sbi); 467 - bdi_destroy(&sbi->bdi); 468 467 exofs_free_sbi(sbi); 469 468 sb->s_fs_info = NULL; 470 469 } ··· 808 809 __sbi_read_stats(sbi); 809 810 810 811 /* set up operation vectors */ 811 - sbi->bdi.ra_pages = __ra_pages(&sbi->layout); 812 - sb->s_bdi = &sbi->bdi; 812 + ret = super_setup_bdi(sb); 813 + if (ret) { 814 + EXOFS_DBGMSG("Failed to super_setup_bdi\n"); 815 + goto free_sbi; 816 + } 817 + sb->s_bdi->ra_pages = __ra_pages(&sbi->layout); 813 818 sb->s_fs_info = sbi; 814 819 sb->s_op = &exofs_sops; 815 820 sb->s_export_op = &exofs_export_ops; ··· 836 833 EXOFS_ERR("ERROR: corrupt root inode (mode = %hd)\n", 837 834 root->i_mode); 838 835 ret = -EINVAL; 839 - goto free_sbi; 840 - } 841 - 842 - ret = bdi_setup_and_register(&sbi->bdi, "exofs"); 843 - if (ret) { 844 - EXOFS_DBGMSG("Failed to bdi_setup_and_register\n"); 845 - dput(sb->s_root); 846 - sb->s_root = NULL; 847 836 goto free_sbi; 848 837 } 849 838