The branch, v3-2-ctdb has been updated
       via  5239011c4938fe99c62169a740323c97f1424f59 (commit)
      from  2f66b4d266b76125c25a5e5ff27db6c74cb76a6a (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb


- Log -----------------------------------------------------------------
commit 5239011c4938fe99c62169a740323c97f1424f59
Author: Volker Lendecke <v...@samba.org>
Date:   Mon May 18 13:30:16 2009 +0200

    Move down the become_root()/unbecome_root() calls into the VFS modules
    
    The aio_fork module does not need this, as it does not communicate via 
signals
    but with pipes. Watching a strace log with those become_root() calls in 
aio.c
    is absolutely awful, and it does affect performance.

-----------------------------------------------------------------------

Summary of changes:
 source/modules/vfs_default.c |   12 ++++++++++--
 source/smbd/aio.c            |    6 ------
 2 files changed, 10 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c
index d46f48a..6505c79 100644
--- a/source/modules/vfs_default.c
+++ b/source/modules/vfs_default.c
@@ -1286,12 +1286,20 @@ static int vfswrap_fsetxattr(struct vfs_handle_struct 
*handle, struct files_stru
 
 static int vfswrap_aio_read(struct vfs_handle_struct *handle, struct 
files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
 {
-       return sys_aio_read(aiocb);
+       int ret;
+       become_root();
+       ret = sys_aio_read(aiocb);
+       unbecome_root();
+       return ret;
 }
 
 static int vfswrap_aio_write(struct vfs_handle_struct *handle, struct 
files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
 {
-       return sys_aio_write(aiocb);
+       int ret;
+       become_root();
+       ret = sys_aio_write(aiocb);
+       unbecome_root();
+       return ret;
 }
 
 static ssize_t vfswrap_aio_return(struct vfs_handle_struct *handle, struct 
files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
diff --git a/source/smbd/aio.c b/source/smbd/aio.c
index c3fd0a2..5c54d27 100644
--- a/source/smbd/aio.c
+++ b/source/smbd/aio.c
@@ -278,15 +278,12 @@ bool schedule_aio_read_and_X(connection_struct *conn,
        a->aio_sigevent.sigev_signo  = RT_SIGNAL_AIO;
        a->aio_sigevent.sigev_value.sival_int = aio_ex->mid;
 
-       become_root();
        if (SMB_VFS_AIO_READ(fsp,a) == -1) {
                DEBUG(0,("schedule_aio_read_and_X: aio_read failed. "
                         "Error %s\n", strerror(errno) ));
                delete_aio_ex(aio_ex);
-               unbecome_root();
                return False;
        }
-       unbecome_root();
 
        DEBUG(10,("schedule_aio_read_and_X: scheduled aio_read for file %s, "
                  "offset %.0f, len = %u (mid = %u)\n",
@@ -379,15 +376,12 @@ bool schedule_aio_write_and_X(connection_struct *conn,
        a->aio_sigevent.sigev_signo  = RT_SIGNAL_AIO;
        a->aio_sigevent.sigev_value.sival_int = aio_ex->mid;
 
-       become_root();
        if (SMB_VFS_AIO_WRITE(fsp,a) == -1) {
                DEBUG(3,("schedule_aio_wrote_and_X: aio_write failed. "
                         "Error %s\n", strerror(errno) ));
                delete_aio_ex(aio_ex);
-               unbecome_root();
                return False;
        }
-       unbecome_root();
        
        release_level_2_oplocks_on_change(fsp);
 


-- 
SAMBA-CTDB repository

Reply via email to