mirror of
https://github.com/samba-team/samba.git
synced 2025-12-17 04:23:50 +03:00
Inlined many of the vfs_XXX calls as macros for speed.
Jeremy.
This commit is contained in:
@@ -3865,15 +3865,8 @@ BOOL vfswrap_lock(files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T
|
|||||||
|
|
||||||
int vfs_init_default(connection_struct *conn);
|
int vfs_init_default(connection_struct *conn);
|
||||||
BOOL vfs_init_custom(connection_struct *conn);
|
BOOL vfs_init_custom(connection_struct *conn);
|
||||||
int vfs_stat(connection_struct *conn, char *fname, SMB_STRUCT_STAT *st);
|
|
||||||
int vfs_fstat(files_struct *fsp, int fd, SMB_STRUCT_STAT *st);
|
|
||||||
BOOL vfs_directory_exist(connection_struct *conn, char *dname, SMB_STRUCT_STAT *st);
|
BOOL vfs_directory_exist(connection_struct *conn, char *dname, SMB_STRUCT_STAT *st);
|
||||||
int vfs_mkdir(connection_struct *conn, char *fname, mode_t mode);
|
int vfs_mkdir(connection_struct *conn, char *fname, mode_t mode);
|
||||||
int vfs_rmdir(connection_struct *conn, char *fname);
|
|
||||||
int vfs_unlink(connection_struct *conn, char *fname);
|
|
||||||
int vfs_chmod(connection_struct *conn, char *fname,mode_t mode);
|
|
||||||
int vfs_chown(connection_struct *conn, char *fname, uid_t uid, gid_t gid);
|
|
||||||
int vfs_chdir(connection_struct *conn, char *fname);
|
|
||||||
char *vfs_getwd(connection_struct *conn, char *unix_path);
|
char *vfs_getwd(connection_struct *conn, char *unix_path);
|
||||||
BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf);
|
BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf);
|
||||||
ssize_t vfs_write_data(files_struct *fsp,char *buffer,size_t N);
|
ssize_t vfs_write_data(files_struct *fsp,char *buffer,size_t N);
|
||||||
|
|||||||
@@ -215,5 +215,46 @@ copy an IP address from one buffer to another
|
|||||||
|
|
||||||
#define dos_format(fname) string_replace(fname,'/','\\')
|
#define dos_format(fname) string_replace(fname,'/','\\')
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
vfs stat wrapper that calls dos_to_unix.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_stat(conn, fname, st) ((conn)->vfs_ops.stat((conn), dos_to_unix((fname),False),(st)))
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
vfs fstat wrapper that calls dos_to_unix.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_fstat(fsp, fd, st) ((fsp)->conn->vfs_ops.fstat((fsp),(fd),(st)))
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
vfs rmdir wrapper that calls dos_to_unix.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_rmdir(conn,fname) ((conn)->vfs_ops.rmdir((conn),dos_to_unix((fname),False)))
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
vfs Unlink wrapper that calls dos_to_unix.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_unlink(conn, fname) ((conn)->vfs_ops.unlink((conn),dos_to_unix((fname),False)))
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
vfs chmod wrapper that calls dos_to_unix.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_chmod(conn,fname,mode) ((conn)->vfs_ops.chmod((conn),dos_to_unix((fname),False),(mode)))
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
vfs chown wrapper that calls dos_to_unix.
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_chown(conn,fname,uid,gid) ((conn)->vfs_ops.chown((conn),dos_to_unix((fname),False),(uid),(gid)))
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
A wrapper for vfs_chdir().
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
#define vfs_chdir(conn,fname) ((conn)->vfs_ops.chdir((conn),dos_to_unix((fname),False)))
|
||||||
|
|
||||||
#endif /* _SMB_MACROS_H */
|
#endif /* _SMB_MACROS_H */
|
||||||
|
|||||||
@@ -254,24 +254,6 @@ BOOL vfs_init_custom(connection_struct *conn)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
vfs stat wrapper that calls dos_to_unix.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_stat(connection_struct *conn, char *fname, SMB_STRUCT_STAT *st)
|
|
||||||
{
|
|
||||||
return(conn->vfs_ops.stat(conn, dos_to_unix(fname,False),st));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
vfs fstat wrapper that calls dos_to_unix.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_fstat(files_struct *fsp, int fd, SMB_STRUCT_STAT *st)
|
|
||||||
{
|
|
||||||
return(fsp->conn->vfs_ops.fstat(fsp,fd,st));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
Check if directory exists.
|
Check if directory exists.
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
@@ -318,51 +300,6 @@ int vfs_mkdir(connection_struct *conn, char *fname, mode_t mode)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
vfs rmdir wrapper that calls dos_to_unix.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_rmdir(connection_struct *conn, char *fname)
|
|
||||||
{
|
|
||||||
return(conn->vfs_ops.rmdir(conn,dos_to_unix(fname,False)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
vfs Unlink wrapper that calls dos_to_unix.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_unlink(connection_struct *conn, char *fname)
|
|
||||||
{
|
|
||||||
return(conn->vfs_ops.unlink(conn,dos_to_unix(fname,False)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
vfs chmod wrapper that calls dos_to_unix.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_chmod(connection_struct *conn, char *fname,mode_t mode)
|
|
||||||
{
|
|
||||||
return(conn->vfs_ops.chmod(conn,dos_to_unix(fname,False), mode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
vfs chown wrapper that calls dos_to_unix.
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_chown(connection_struct *conn, char *fname, uid_t uid, gid_t gid)
|
|
||||||
{
|
|
||||||
return(conn->vfs_ops.chown(conn,dos_to_unix(fname,False), uid, gid));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
A wrapper for vfs_chdir().
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
int vfs_chdir(connection_struct *conn, char *fname)
|
|
||||||
{
|
|
||||||
return(conn->vfs_ops.chdir(conn,dos_to_unix(fname,False)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
vfs getwd wrapper that calls dos_to_unix.
|
vfs getwd wrapper that calls dos_to_unix.
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user