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

ncpfs: 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: Petr Vandrovec <petr@vandrovec.name>
Acked-by: Petr Vandrovec <petr@vandrovec.name>
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
a0349ec0 0546c537

+2 -7
+2 -6
fs/ncpfs/inode.c
··· 554 554 sb->s_magic = NCP_SUPER_MAGIC; 555 555 sb->s_op = &ncp_sops; 556 556 sb->s_d_op = &ncp_dentry_operations; 557 - sb->s_bdi = &server->bdi; 558 557 559 558 server = NCP_SBP(sb); 560 559 memset(server, 0, sizeof(*server)); 561 560 562 - error = bdi_setup_and_register(&server->bdi, "ncpfs"); 561 + error = super_setup_bdi(sb); 563 562 if (error) 564 563 goto out_fput; 565 564 ··· 567 568 if (data.info_fd != -1) { 568 569 struct socket *info_sock = sockfd_lookup(data.info_fd, &error); 569 570 if (!info_sock) 570 - goto out_bdi; 571 + goto out_fput; 571 572 server->info_sock = info_sock; 572 573 error = -EBADFD; 573 574 if (info_sock->type != SOCK_STREAM) ··· 745 746 out_fput2: 746 747 if (server->info_sock) 747 748 sockfd_put(server->info_sock); 748 - out_bdi: 749 - bdi_destroy(&server->bdi); 750 749 out_fput: 751 750 sockfd_put(sock); 752 751 out: ··· 785 788 kill_pid(server->m.wdog_pid, SIGTERM, 1); 786 789 put_pid(server->m.wdog_pid); 787 790 788 - bdi_destroy(&server->bdi); 789 791 kfree(server->priv.data); 790 792 kfree(server->auth.object_name); 791 793 vfree(server->rxbuf);
-1
fs/ncpfs/ncp_fs_sb.h
··· 143 143 size_t len; 144 144 __u8 data[128]; 145 145 } unexpected_packet; 146 - struct backing_dev_info bdi; 147 146 }; 148 147 149 148 extern void ncp_tcp_rcv_proc(struct work_struct *work);