summaryrefslogtreecommitdiffstats
path: root/source/smbd/reply.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2008-01-16 12:17:03 +0300
committerAlexander Bokovoy <ab@samba.org>2008-01-16 12:17:03 +0300
commit875208724e39564fe81385dfe36e6c963e79e101 (patch)
tree400a646c070edd782d39cda99c002f672b0959b0 /source/smbd/reply.c
parent0c8e23afbbb2d081fc23908bafcad04650bfacea (diff)
downloadsamba-875208724e39564fe81385dfe36e6c963e79e101.tar.gz
samba-875208724e39564fe81385dfe36e6c963e79e101.tar.xz
samba-875208724e39564fe81385dfe36e6c963e79e101.zip
Add support for offline files support, remote storage, and Async I/O force operations to VFS
Offline files support and remote storage are for allowing communication with backup and archiving tools that mark files moved to a tape library as offline. We translate this info into corresponding CIFS offline file attribute and mark an exported volume as remote storage. Async I/O force is to allow selective redirection of I/O operations to asynchronous processing in case it is viable at VFS module discretion. It is needed for proper handling of offline files as performing regular I/O on offline file will block smbd. Signed-off-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r--source/smbd/reply.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index e2316ef1200..381ddfe1517 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -3329,8 +3329,12 @@ void reply_read_and_X(struct smb_request *req)
return;
}
- if (!big_readX
- && schedule_aio_read_and_X(conn, req, fsp, startpos, smb_maxcnt)) {
+ /* It is possible for VFS modules to selectively decide whether Async I/O should be used
+ for the file or not.
+ */
+ if ((SMB_VFS_AIO_FORCE(fsp)) &&
+ !big_readX &&
+ schedule_aio_read_and_X(conn, req, fsp, startpos, smb_maxcnt)) {
END_PROFILE(SMBreadX);
return;
}
@@ -4001,13 +4005,16 @@ void reply_write_and_X(struct smb_request *req)
nwritten = 0;
} else {
- if (req->unread_bytes == 0 &&
- schedule_aio_write_and_X(conn, req, fsp, data,
- startpos, numtowrite)) {
+ /* It is possible for VFS modules to selectively decide whether Async I/O
+ should be used for the file or not.
+ */
+ if ((SMB_VFS_AIO_FORCE(fsp)) && (req->unread_bytes == 0) &&
+ schedule_aio_write_and_X(conn, req, fsp, data, startpos,
+ numtowrite)) {
END_PROFILE(SMBwriteX);
return;
}
-
+
nwritten = write_file(req,fsp,data,startpos,numtowrite);
}