ncpfs: add bdi backing to mount session
This ensures that dirty data gets flushed properly. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
b3d0ab7e60
commit
f1970c73cb
2 changed files with 10 additions and 0 deletions
|
@ -526,10 +526,15 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
|
||||||
sb->s_blocksize_bits = 10;
|
sb->s_blocksize_bits = 10;
|
||||||
sb->s_magic = NCP_SUPER_MAGIC;
|
sb->s_magic = NCP_SUPER_MAGIC;
|
||||||
sb->s_op = &ncp_sops;
|
sb->s_op = &ncp_sops;
|
||||||
|
sb->s_bdi = &server->bdi;
|
||||||
|
|
||||||
server = NCP_SBP(sb);
|
server = NCP_SBP(sb);
|
||||||
memset(server, 0, sizeof(*server));
|
memset(server, 0, sizeof(*server));
|
||||||
|
|
||||||
|
error = bdi_setup_and_register(&server->bdi, "ncpfs", BDI_CAP_MAP_COPY);
|
||||||
|
if (error)
|
||||||
|
goto out_bdi;
|
||||||
|
|
||||||
server->ncp_filp = ncp_filp;
|
server->ncp_filp = ncp_filp;
|
||||||
server->ncp_sock = sock;
|
server->ncp_sock = sock;
|
||||||
|
|
||||||
|
@ -719,6 +724,8 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
|
||||||
if (server->info_filp)
|
if (server->info_filp)
|
||||||
fput(server->info_filp);
|
fput(server->info_filp);
|
||||||
out_fput:
|
out_fput:
|
||||||
|
bdi_destroy(&server->bdi);
|
||||||
|
out_bdi:
|
||||||
/* 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>:
|
/* 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>:
|
||||||
*
|
*
|
||||||
* The previously used put_filp(ncp_filp); was bogous, since
|
* The previously used put_filp(ncp_filp); was bogous, since
|
||||||
|
@ -756,6 +763,7 @@ static void ncp_put_super(struct super_block *sb)
|
||||||
kill_pid(server->m.wdog_pid, SIGTERM, 1);
|
kill_pid(server->m.wdog_pid, SIGTERM, 1);
|
||||||
put_pid(server->m.wdog_pid);
|
put_pid(server->m.wdog_pid);
|
||||||
|
|
||||||
|
bdi_destroy(&server->bdi);
|
||||||
kfree(server->priv.data);
|
kfree(server->priv.data);
|
||||||
kfree(server->auth.object_name);
|
kfree(server->auth.object_name);
|
||||||
vfree(server->rxbuf);
|
vfree(server->rxbuf);
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <linux/ncp_mount.h>
|
#include <linux/ncp_mount.h>
|
||||||
#include <linux/net.h>
|
#include <linux/net.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
#include <linux/backing-dev.h>
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
|
|
||||||
|
@ -127,6 +128,7 @@ struct ncp_server {
|
||||||
size_t len;
|
size_t len;
|
||||||
__u8 data[128];
|
__u8 data[128];
|
||||||
} unexpected_packet;
|
} unexpected_packet;
|
||||||
|
struct backing_dev_info bdi;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void ncp_tcp_rcv_proc(struct work_struct *work);
|
extern void ncp_tcp_rcv_proc(struct work_struct *work);
|
||||||
|
|
Loading…
Reference in a new issue