Lines Matching refs:server
165 struct ncp_server *server = NCP_SERVER(inode); in ncp_update_attrs() local
168 inode->i_mode = server->m.dir_mode; in ncp_update_attrs()
175 inode->i_mode = server->m.file_mode; in ncp_update_attrs()
179 if ((server->m.flags & (NCP_MOUNT_EXTRAS|NCP_MOUNT_SYMLINKS)) in ncp_update_attrs()
183 if (server->m.flags & NCP_MOUNT_SYMLINKS) { in ncp_update_attrs()
193 if (server->m.flags & NCP_MOUNT_EXTRAS) in ncp_update_attrs()
197 if (server->m.flags & NCP_MOUNT_EXTRAS) in ncp_update_attrs()
228 struct ncp_server *server = NCP_SERVER(inode); in ncp_set_attr() local
237 inode->i_uid = server->m.uid; in ncp_set_attr()
238 inode->i_gid = server->m.gid; in ncp_set_attr()
313 static void ncp_stop_tasks(struct ncp_server *server) { in ncp_stop_tasks() argument
314 struct sock* sk = server->ncp_sock->sk; in ncp_stop_tasks()
317 sk->sk_error_report = server->error_report; in ncp_stop_tasks()
318 sk->sk_data_ready = server->data_ready; in ncp_stop_tasks()
319 sk->sk_write_space = server->write_space; in ncp_stop_tasks()
321 del_timer_sync(&server->timeout_tm); in ncp_stop_tasks()
323 flush_work(&server->rcv.tq); in ncp_stop_tasks()
325 flush_work(&server->tx.tq); in ncp_stop_tasks()
327 flush_work(&server->timeout_tq); in ncp_stop_tasks()
332 struct ncp_server *server = NCP_SBP(root->d_sb); in ncp_show_options() local
335 if (!uid_eq(server->m.uid, GLOBAL_ROOT_UID)) in ncp_show_options()
337 from_kuid_munged(&init_user_ns, server->m.uid)); in ncp_show_options()
338 if (!gid_eq(server->m.gid, GLOBAL_ROOT_GID)) in ncp_show_options()
340 from_kgid_munged(&init_user_ns, server->m.gid)); in ncp_show_options()
341 if (!uid_eq(server->m.mounted_uid, GLOBAL_ROOT_UID)) in ncp_show_options()
343 from_kuid_munged(&init_user_ns, server->m.mounted_uid)); in ncp_show_options()
344 tmp = server->m.file_mode & S_IALLUGO; in ncp_show_options()
347 tmp = server->m.dir_mode & S_IALLUGO; in ncp_show_options()
350 if (server->m.time_out != NCP_DEFAULT_TIME_OUT * HZ / 100) { in ncp_show_options()
351 tmp = server->m.time_out * 100 / HZ; in ncp_show_options()
354 if (server->m.retry_count != NCP_DEFAULT_RETRY_COUNT) in ncp_show_options()
355 seq_printf(seq, ",retry=%u", server->m.retry_count); in ncp_show_options()
356 if (server->m.flags != 0) in ncp_show_options()
357 seq_printf(seq, ",flags=%lu", server->m.flags); in ncp_show_options()
358 if (server->m.wdog_pid != NULL) in ncp_show_options()
359 seq_printf(seq, ",wdogpid=%u", pid_vnr(server->m.wdog_pid)); in ncp_show_options()
471 struct ncp_server *server; in ncp_fill_super() local
482 server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL); in ncp_fill_super()
483 if (!server) in ncp_fill_super()
485 sb->s_fs_info = server; in ncp_fill_super()
557 sb->s_bdi = &server->bdi; in ncp_fill_super()
559 server = NCP_SBP(sb); in ncp_fill_super()
560 memset(server, 0, sizeof(*server)); in ncp_fill_super()
562 error = bdi_setup_and_register(&server->bdi, "ncpfs"); in ncp_fill_super()
566 server->ncp_sock = sock; in ncp_fill_super()
572 server->info_sock = info_sock; in ncp_fill_super()
579 mutex_init(&server->mutex); in ncp_fill_super()
580 server->packet = NULL; in ncp_fill_super()
585 mutex_init(&server->root_setup_lock); in ncp_fill_super()
590 init_rwsem(&server->auth_rwsem); in ncp_fill_super()
591 server->auth.auth_type = NCP_AUTH_NONE; in ncp_fill_super()
598 server->m = data; in ncp_fill_super()
601 if (server->m.time_out < 1) { in ncp_fill_super()
602 server->m.time_out = 10; in ncp_fill_super()
605 server->m.time_out = server->m.time_out * HZ / 100; in ncp_fill_super()
606 server->m.file_mode = (server->m.file_mode & S_IRWXUGO) | S_IFREG; in ncp_fill_super()
607 server->m.dir_mode = (server->m.dir_mode & S_IRWXUGO) | S_IFDIR; in ncp_fill_super()
611 server->nls_vol = load_nls_default(); in ncp_fill_super()
612 server->nls_io = load_nls_default(); in ncp_fill_super()
615 atomic_set(&server->dentry_ttl, 0); /* no caching */ in ncp_fill_super()
617 INIT_LIST_HEAD(&server->tx.requests); in ncp_fill_super()
618 mutex_init(&server->rcv.creq_mutex); in ncp_fill_super()
619 server->tx.creq = NULL; in ncp_fill_super()
620 server->rcv.creq = NULL; in ncp_fill_super()
622 init_timer(&server->timeout_tm); in ncp_fill_super()
626 server->packet_size = NCP_PACKET_SIZE; in ncp_fill_super()
627 server->packet = vmalloc(NCP_PACKET_SIZE); in ncp_fill_super()
628 if (server->packet == NULL) in ncp_fill_super()
630 server->txbuf = vmalloc(NCP_PACKET_SIZE); in ncp_fill_super()
631 if (server->txbuf == NULL) in ncp_fill_super()
633 server->rxbuf = vmalloc(NCP_PACKET_SIZE); in ncp_fill_super()
634 if (server->rxbuf == NULL) in ncp_fill_super()
638 server->data_ready = sock->sk->sk_data_ready; in ncp_fill_super()
639 server->write_space = sock->sk->sk_write_space; in ncp_fill_super()
640 server->error_report = sock->sk->sk_error_report; in ncp_fill_super()
641 sock->sk->sk_user_data = server; in ncp_fill_super()
645 server->rcv.ptr = (unsigned char*)&server->rcv.buf; in ncp_fill_super()
646 server->rcv.len = 10; in ncp_fill_super()
647 server->rcv.state = 0; in ncp_fill_super()
648 INIT_WORK(&server->rcv.tq, ncp_tcp_rcv_proc); in ncp_fill_super()
649 INIT_WORK(&server->tx.tq, ncp_tcp_tx_proc); in ncp_fill_super()
652 INIT_WORK(&server->rcv.tq, ncpdgram_rcv_proc); in ncp_fill_super()
653 INIT_WORK(&server->timeout_tq, ncpdgram_timeout_proc); in ncp_fill_super()
654 server->timeout_tm.data = (unsigned long)server; in ncp_fill_super()
655 server->timeout_tm.function = ncpdgram_timeout_call; in ncp_fill_super()
659 ncp_lock_server(server); in ncp_fill_super()
660 error = ncp_connect(server); in ncp_fill_super()
661 ncp_unlock_server(server); in ncp_fill_super()
668 if (ncp_negotiate_size_and_options(server, default_bufsize, in ncp_fill_super()
669 NCP_DEFAULT_OPTIONS, &(server->buffer_size), &options) == 0) in ncp_fill_super()
673 if (ncp_negotiate_size_and_options(server, in ncp_fill_super()
676 &(server->buffer_size), &options) != 0) in ncp_fill_super()
682 ncp_lock_server(server); in ncp_fill_super()
684 server->sign_wanted = 1; in ncp_fill_super()
685 ncp_unlock_server(server); in ncp_fill_super()
689 if (ncp_negotiate_buffersize(server, default_bufsize, in ncp_fill_super()
690 &(server->buffer_size)) != 0) in ncp_fill_super()
692 ncp_dbg(1, "bufsize = %d\n", server->buffer_size); in ncp_fill_super()
715 server->name_space[finfo.volume] = NW_NS_DOS; in ncp_fill_super()
728 ncp_lock_server(server); in ncp_fill_super()
729 ncp_disconnect(server); in ncp_fill_super()
730 ncp_unlock_server(server); in ncp_fill_super()
732 ncp_stop_tasks(server); in ncp_fill_super()
733 vfree(server->rxbuf); in ncp_fill_super()
735 vfree(server->txbuf); in ncp_fill_super()
737 vfree(server->packet); in ncp_fill_super()
740 unload_nls(server->nls_io); in ncp_fill_super()
741 unload_nls(server->nls_vol); in ncp_fill_super()
743 mutex_destroy(&server->rcv.creq_mutex); in ncp_fill_super()
744 mutex_destroy(&server->root_setup_lock); in ncp_fill_super()
745 mutex_destroy(&server->mutex); in ncp_fill_super()
747 if (server->info_sock) in ncp_fill_super()
748 sockfd_put(server->info_sock); in ncp_fill_super()
750 bdi_destroy(&server->bdi); in ncp_fill_super()
756 kfree(server); in ncp_fill_super()
762 struct ncp_server *server = container_of(p, struct ncp_server, rcu); in delayed_free() local
765 unload_nls(server->nls_vol); in delayed_free()
766 unload_nls(server->nls_io); in delayed_free()
768 kfree(server); in delayed_free()
773 struct ncp_server *server = NCP_SBP(sb); in ncp_put_super() local
775 ncp_lock_server(server); in ncp_put_super()
776 ncp_disconnect(server); in ncp_put_super()
777 ncp_unlock_server(server); in ncp_put_super()
779 ncp_stop_tasks(server); in ncp_put_super()
781 mutex_destroy(&server->rcv.creq_mutex); in ncp_put_super()
782 mutex_destroy(&server->root_setup_lock); in ncp_put_super()
783 mutex_destroy(&server->mutex); in ncp_put_super()
785 if (server->info_sock) in ncp_put_super()
786 sockfd_put(server->info_sock); in ncp_put_super()
787 sockfd_put(server->ncp_sock); in ncp_put_super()
788 kill_pid(server->m.wdog_pid, SIGTERM, 1); in ncp_put_super()
789 put_pid(server->m.wdog_pid); in ncp_put_super()
791 bdi_destroy(&server->bdi); in ncp_put_super()
792 kfree(server->priv.data); in ncp_put_super()
793 kfree(server->auth.object_name); in ncp_put_super()
794 vfree(server->rxbuf); in ncp_put_super()
795 vfree(server->txbuf); in ncp_put_super()
796 vfree(server->packet); in ncp_put_super()
797 call_rcu(&server->rcu, delayed_free); in ncp_put_super()
872 struct ncp_server *server; in ncp_notify_change() local
876 server = NCP_SERVER(inode); in ncp_notify_change()
877 if (!server) /* How this could happen? */ in ncp_notify_change()
885 ncp_age_dentry(server, dentry); in ncp_notify_change()
892 if ((attr->ia_valid & ATTR_UID) && !uid_eq(attr->ia_uid, server->m.uid)) in ncp_notify_change()
895 if ((attr->ia_valid & ATTR_GID) && !gid_eq(attr->ia_gid, server->m.gid)) in ncp_notify_change()
914 newmode &= server->m.dir_mode; in ncp_notify_change()
917 if (server->m.flags & NCP_MOUNT_EXTRAS) { in ncp_notify_change()
919 if (newmode & ~server->m.file_mode & S_IXUGO) in ncp_notify_change()
922 else if (newmode & ~server->m.file_mode & S_IRUGO) in ncp_notify_change()
926 newmode &= server->m.file_mode; in ncp_notify_change()
934 if (ncp_is_nfs_extras(server, NCP_FINFO(inode)->volNumber)) { in ncp_notify_change()
935 result = ncp_modify_nfs_info(server, in ncp_notify_change()