summaryrefslogtreecommitdiff
path: root/source4/client/cifsddio.c
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-02-01 06:05:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:42 -0500
commitb94280cd75e84ada390d12f5b9fdb45e76128cc4 (patch)
treebe5a0bf25b4f8d6e66ecab52adf7cb425a2469ae /source4/client/cifsddio.c
parentce4f56dbdc07f3f31664f057888af93ea30284f2 (diff)
downloadsamba-b94280cd75e84ada390d12f5b9fdb45e76128cc4.tar.gz
r13280: Tidy up formatting.
(This used to be commit 531995000df77a54a4f2d7734e1ad33cd7cda37a)
Diffstat (limited to 'source4/client/cifsddio.c')
-rw-r--r--source4/client/cifsddio.c67
1 files changed, 46 insertions, 21 deletions
diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c
index b13cf3fd08c..34007bd4d78 100644
--- a/source4/client/cifsddio.c
+++ b/source4/client/cifsddio.c
@@ -53,14 +53,18 @@ static BOOL fd_seek_func(void * handle, uint64_t offset)
return(True);
}
-static BOOL fd_read_func(void * handle, uint8_t * buf, uint64_t wanted, uint64_t * actual)
+static BOOL fd_read_func(void * handle,
+ uint8_t * buf,
+ uint64_t wanted,
+ uint64_t * actual)
{
ssize_t ret;
ret = read(IO_HANDLE_TO_FD(handle), buf, wanted);
if (ret < 0) {
fprintf(stderr, "%s: %llu byte read failed: %s\n",
- PROGNAME, (unsigned long long)wanted, strerror(errno));
+ PROGNAME, (unsigned long long)wanted,
+ strerror(errno));
return(False);
}
@@ -68,15 +72,18 @@ static BOOL fd_read_func(void * handle, uint8_t * buf, uint64_t wanted, uint64_t
return(True);
}
-static BOOL
-fd_write_func(void * handle, uint8_t * buf, uint64_t wanted, uint64_t * actual)
+static BOOL fd_write_func(void * handle,
+ uint8_t * buf,
+ uint64_t wanted,
+ uint64_t * actual)
{
ssize_t ret;
ret = write(IO_HANDLE_TO_FD(handle), buf, wanted);
if (ret < 0) {
fprintf(stderr, "%s: %llu byte write failed: %s\n",
- PROGNAME, (unsigned long long)wanted, strerror(errno));
+ PROGNAME, (unsigned long long)wanted,
+ strerror(errno));
return(False);
}
@@ -84,8 +91,9 @@ fd_write_func(void * handle, uint8_t * buf, uint64_t wanted, uint64_t * actual)
return(True);
}
-static struct dd_iohandle *
-open_fd_handle(const char * path, uint64_t iosz, int options)
+static struct dd_iohandle * open_fd_handle(const char * path,
+ uint64_t iosz,
+ int options)
{
struct fd_handle * fdh;
int oflags = 0;
@@ -148,8 +156,10 @@ BOOL smb_seek_func(void * handle, uint64_t offset)
return(True);
}
-BOOL smb_read_func(void * handle, uint8_t * buf,
- uint64_t wanted, uint64_t * actual)
+BOOL smb_read_func(void * handle,
+ uint8_t * buf,
+ uint64_t wanted,
+ uint64_t * actual)
{
NTSTATUS ret;
union smb_read r;
@@ -171,7 +181,8 @@ BOOL smb_read_func(void * handle, uint8_t * buf,
ret = smb_raw_read(smbh->cli->tree, &r);
if (!NT_STATUS_IS_OK(ret)) {
fprintf(stderr, "%s: %llu byte read failed: %s\n",
- PROGNAME, (unsigned long long)wanted, nt_errstr(ret));
+ PROGNAME, (unsigned long long)wanted,
+ nt_errstr(ret));
return(False);
}
@@ -183,8 +194,10 @@ BOOL smb_read_func(void * handle, uint8_t * buf,
return(True);
}
-BOOL smb_write_func(void * handle, uint8_t * buf,
- uint64_t wanted, uint64_t * actual)
+BOOL smb_write_func(void * handle,
+ uint8_t * buf,
+ uint64_t wanted,
+ uint64_t * actual)
{
NTSTATUS ret;
union smb_write w;
@@ -202,7 +215,8 @@ BOOL smb_write_func(void * handle, uint8_t * buf,
ret = smb_raw_write(smbh->cli->tree, &w);
if (!NT_STATUS_IS_OK(ret)) {
fprintf(stderr, "%s: %llu byte write failed: %s\n",
- PROGNAME, (unsigned long long)wanted, nt_errstr(ret));
+ PROGNAME, (unsigned long long)wanted,
+ nt_errstr(ret));
return(False);
}
@@ -211,7 +225,8 @@ BOOL smb_write_func(void * handle, uint8_t * buf,
return(True);
}
-static struct smbcli_state * init_smb_session(const char * host, const char * share)
+static struct smbcli_state * init_smb_session(const char * host,
+ const char * share)
{
NTSTATUS ret;
struct smbcli_state * cli = NULL;
@@ -231,7 +246,9 @@ static struct smbcli_state * init_smb_session(const char * host, const char * sh
return(cli);
}
-static int open_smb_file(struct smbcli_state * cli, const char * path, int options)
+static int open_smb_file(struct smbcli_state * cli,
+ const char * path,
+ int options)
{
NTSTATUS ret;
union smb_open o;
@@ -276,8 +293,11 @@ static int open_smb_file(struct smbcli_state * cli, const char * path, int optio
return(o.ntcreatex.out.fnum);
}
-static struct dd_iohandle * open_smb_handle(const char * host, const char * share,
- const char * path, uint64_t iosz, int options)
+static struct dd_iohandle * open_smb_handle(const char * host,
+ const char * share,
+ const char * path,
+ uint64_t iosz,
+ int options)
{
struct smb_handle * smbh;
@@ -337,8 +357,11 @@ struct dd_iohandle * dd_open_path(const char * path, uint64_t iosz, int options)
* NOTE: The IO buffer is guaranteed to be big enough to fit needsz + blocksz
* bytes into it.
*/
-BOOL dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
- uint64_t * bufsz, uint64_t needsz, uint64_t blocksz)
+BOOL dd_fill_block(struct dd_iohandle * h,
+ uint8_t * buf,
+ uint64_t * bufsz,
+ uint64_t needsz,
+ uint64_t blocksz)
{
uint64_t readsz;
@@ -378,8 +401,10 @@ BOOL dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
* and shift any remaining bytes back to the head of the buffer when there are
* no more blocksz sized IOs left.
*/
-BOOL dd_flush_block(struct dd_iohandle * h, uint8_t * buf,
- uint64_t * bufsz, uint64_t blocksz)
+BOOL dd_flush_block(struct dd_iohandle * h,
+ uint8_t * buf,
+ uint64_t * bufsz,
+ uint64_t blocksz)
{
uint64_t writesz;
uint64_t totalsz = 0;