files_struct *fsp;
struct lock_struct lock;
off_t size = 0;
+ NTSTATUS status;
START_PROFILE(SMBreadbraw);
return;
}
- if (fsp_stat(fsp) == 0) {
+ status = vfs_stat_fsp(fsp);
+ if (NT_STATUS_IS_OK(status)) {
size = fsp->fsp_name->st.st_ex_size;
}
ssize_t nread = -1;
struct lock_struct lock;
int saved_errno = 0;
+ NTSTATUS status;
init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK,
uint8_t headerbuf[smb_size + 12 * 2 + 1 /* padding byte */];
DATA_BLOB header;
- if(fsp_stat(fsp) == -1) {
- reply_nterror(req, map_nt_error_from_unix(errno));
+ status = vfs_stat_fsp(fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
goto out;
}
off_t res= -1;
int mode,umode;
files_struct *fsp;
+ NTSTATUS status;
START_PROFILE(SMBlseek);
if(errno == EINVAL) {
off_t current_pos = startpos;
- if(fsp_stat(fsp) == -1) {
- reply_nterror(req,
- map_nt_error_from_unix(errno));
+ status = vfs_stat_fsp(fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
END_PROFILE(SMBlseek);
return;
}
int mode;
files_struct *fsp;
struct timespec create_ts;
+ NTSTATUS status;
START_PROFILE(SMBgetattrE);
}
/* Do an fstat on this file */
- if(fsp_stat(fsp)) {
- reply_nterror(req, map_nt_error_from_unix(errno));
+ status = vfs_stat_fsp(fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
END_PROFILE(SMBgetattrE);
return;
}