The Samba copy file call flow

GongJinrong jinronggong at hotmail.com
Wed Apr 30 21:52:12 MDT 2014


Hi, Jeremy

   I found that if I enable a vfs object(such as full_audit), I can see the
write_file() print log, but if I don't enable any VFS object, I cannot find
the file data write operations, can you tell me how samba store a file to
disk without VFS object? Where is the real file write code?

-----Original Message-----
From: samba-technical-bounces at lists.samba.org
[mailto:samba-technical-bounces at lists.samba.org] On Behalf Of GongJinrong
Sent: Thursday, May 01, 2014 9:42 AM
To: 'Jeremy Allison'
Cc: samba-technical at lists.samba.org
Subject: RE: The Samba copy file call flow

Hi, Jeremy

    Thanks a lot, the guide is really useful, but I cannot see the
real_write_file() be called when I copy a file to linux shared directory,
which function will call the VFS routine? is the file data receiving routine
in the Tevent handler functions? sorry for so much question^^
    

-----Original Message-----
From: Jeremy Allison [mailto:jra at samba.org]
Sent: Thursday, May 01, 2014 7:27 AM
To: GongJinrong
Cc: samba-technical at lists.samba.org
Subject: Re: The Samba copy file call flow

On Thu, May 01, 2014 at 12:36:49AM +0800, GongJinrong wrote:

>    I am learning the samba source code, it's really hard to understand 
> the whole samba architecture, I don't find the detail call stack or 
> call flow in samba when I do a file copying from win7 to a linux 
> shared directory, I put some debug code to vfs_write_data() and 
> real_write_file(), but I cannot see the debug print in the log file, 
> can any nice guy tell me how the samba create file and write file data 
> to disk, which low level file operation wrapper function will be 
> called? Thanks a lot! I already spent a whole week, but got nothing!

Sorry you're having so much trouble. You can start from real_write_file() -
but notice it calls vfs_pwrite_data(), not vfs_write_data().

Feel free to ask specific questions
on the list. Richard Sharpe has a
good guide to the Samba VFS you
might want to read.

Keep at it - the more you read
the code the more you'll find a treasure trove of useful things :-). Talloc,
tevent, tdb, ctdb, pthreadpool, they're all here :-).

Jeremy.


More information about the samba-technical mailing list