* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "includes.h"
#include "onefs.h"
+#include "onefs_config.h"
+#include "oplock_onefs.h"
#include <ifs/ifs_syscalls.h>
#include <isi_acl/isi_acl_util.h>
+#include <sys/isi_acl.h>
/*
* Initialize the sm_lock struct before passing it to ifs_createfile.
status = onefs_samba_sd_to_sd(secinfo, sd, &ifs_sd, SNUM(conn));
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("SD initialization failure: %s",
+ DEBUG(1, ("SD initialization failure: %s\n",
nt_errstr(status)));
errno = EINVAL;
goto out;
open_access_mask));
}
- DEBUG(10,("onefs_sys_create_file: base_fd = %d, "
+ DEBUG(10,("onefs_sys_create_file: base_fd = %d, fname = %s"
"open_access_mask = 0x%x, flags = 0x%x, mode = 0%o, "
"desired_oplock = %s, id = 0x%x, secinfo = 0x%x, sd = %p, "
"dos_attributes = 0x%x, path = %s, "
- "default_acl=%s\n", base_fd,
+ "default_acl=%s\n", base_fd, path,
(unsigned int)open_access_mask,
(unsigned int)flags,
(unsigned int)mode,
/* If the sendfile wasn't atomic, we're done. */
if (!atomic) {
- DEBUG(10, ("non-atomic sendfile read %ul bytes", ret));
+ DEBUG(10, ("non-atomic sendfile read %ul bytes\n", ret));
END_PROFILE(syscall_sendfile);
return ret;
}
}
if (count < 0x10000) {
- DEBUG(0, ("Count < 2^16 and E2BIG was returned! %lu",
+ DEBUG(0, ("Count < 2^16 and E2BIG was returned! %lu\n",
count));
}
*/
while (total_rbytes < count) {
- DEBUG(0, ("shallow recvfile, reading %llu\n",
- count - total_rbytes));
+ DEBUG(0, ("shallow recvfile (%s), reading %llu\n",
+ strerror(errno), count - total_rbytes));
/*
* Read the remaining data into the spill buffer. recvfile
spill_buffer + (total_rbytes - total_wbytes),
count - total_rbytes);
- if (ret == -1) {
- DEBUG(0, ("shallow recvfile read failed: %s\n",
- strerror(errno)));
+ if (ret <= 0) {
+ if (ret == 0) {
+ DEBUG(0, ("shallow recvfile read: EOF\n"));
+ } else {
+ DEBUG(0, ("shallow recvfile read failed: %s\n",
+ strerror(errno)));
+ }
/* Socket is dead, so treat as if it were drained. */
socket_drained = true;
goto out;
return ret;
}
-
-/**
- * Set the per-process encoding, ignoring errors.
- */
-void onefs_sys_config_enc(void)
-{
- int ret;
-
- ret = enc_set_proc(ENC_UTF8);
- if (ret) {
- DEBUG(0, ("Setting process encoding failed: %s",
- strerror(errno)));
- }
-}
-
-/**
- * Set the per-process .snpashot directory options, ignoring errors.
- */
-void onefs_sys_config_snap_opt(struct onefs_vfs_global_config *global_config)
-{
- struct ifs_dotsnap_options dso;
- int ret;
-
- dso.per_proc = 1;
- dso.sub_accessible = global_config->dot_snap_child_accessible;
- dso.sub_visible = global_config->dot_snap_child_visible;
- dso.root_accessible = global_config->dot_snap_root_accessible;
- dso.root_visible = global_config->dot_snap_root_visible;
-
- ret = ifs_set_dotsnap_options(&dso);
- if (ret) {
- DEBUG(0, ("Setting snapshot visibility/accessibility "
- "failed: %s", strerror(errno)));
- }
-}
-
-/**
- * Set the per-process flag saying whether or not to accept ~snapshot
- * as an alternative name for .snapshot directories.
- */
-void onefs_sys_config_tilde(struct onefs_vfs_global_config *global_config)
-{
- int ret;
-
- ret = ifs_tilde_snapshot(global_config->dot_snap_tilde);
- if (ret) {
- DEBUG(0, ("Setting snapshot tilde failed: %s",
- strerror(errno)));
- }
-}