Commit f1970c73cbb6b884152207e4dfe90639f5029905
1 parent
b3d0ab7e60
Exists in
master
and in
7 other branches
ncpfs: add bdi backing to mount session
This ensures that dirty data gets flushed properly. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Showing 2 changed files with 10 additions and 0 deletions Side-by-side Diff
fs/ncpfs/inode.c
... | ... | @@ -526,10 +526,15 @@ |
526 | 526 | sb->s_blocksize_bits = 10; |
527 | 527 | sb->s_magic = NCP_SUPER_MAGIC; |
528 | 528 | sb->s_op = &ncp_sops; |
529 | + sb->s_bdi = &server->bdi; | |
529 | 530 | |
530 | 531 | server = NCP_SBP(sb); |
531 | 532 | memset(server, 0, sizeof(*server)); |
532 | 533 | |
534 | + error = bdi_setup_and_register(&server->bdi, "ncpfs", BDI_CAP_MAP_COPY); | |
535 | + if (error) | |
536 | + goto out_bdi; | |
537 | + | |
533 | 538 | server->ncp_filp = ncp_filp; |
534 | 539 | server->ncp_sock = sock; |
535 | 540 | |
... | ... | @@ -719,6 +724,8 @@ |
719 | 724 | if (server->info_filp) |
720 | 725 | fput(server->info_filp); |
721 | 726 | out_fput: |
727 | + bdi_destroy(&server->bdi); | |
728 | +out_bdi: | |
722 | 729 | /* 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>: |
723 | 730 | * |
724 | 731 | * The previously used put_filp(ncp_filp); was bogous, since |
... | ... | @@ -756,6 +763,7 @@ |
756 | 763 | kill_pid(server->m.wdog_pid, SIGTERM, 1); |
757 | 764 | put_pid(server->m.wdog_pid); |
758 | 765 | |
766 | + bdi_destroy(&server->bdi); | |
759 | 767 | kfree(server->priv.data); |
760 | 768 | kfree(server->auth.object_name); |
761 | 769 | vfree(server->rxbuf); |
include/linux/ncp_fs_sb.h
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | #include <linux/ncp_mount.h> |
13 | 13 | #include <linux/net.h> |
14 | 14 | #include <linux/mutex.h> |
15 | +#include <linux/backing-dev.h> | |
15 | 16 | |
16 | 17 | #ifdef __KERNEL__ |
17 | 18 | |
... | ... | @@ -127,6 +128,7 @@ |
127 | 128 | size_t len; |
128 | 129 | __u8 data[128]; |
129 | 130 | } unexpected_packet; |
131 | + struct backing_dev_info bdi; | |
130 | 132 | }; |
131 | 133 | |
132 | 134 | extern void ncp_tcp_rcv_proc(struct work_struct *work); |