2 * Unix SMB/CIFS implementation.
5 * Copyright (C) Steven Danneman, 2008
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 * vfs interface handlers
27 SMB_STRUCT_DIR *onefs_opendir(struct vfs_handle_struct *handle,
28 const char *fname, const char *mask,
31 SMB_STRUCT_DIRENT *onefs_readdir(struct vfs_handle_struct *handle,
32 SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf);
34 void onefs_seekdir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
37 long onefs_telldir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
39 void onefs_rewinddir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);
41 int onefs_closedir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);
43 void onefs_init_search_op(struct vfs_handle_struct *handle,
44 SMB_STRUCT_DIR *dirp);
46 NTSTATUS onefs_create_file(vfs_handle_struct *handle,
47 struct smb_request *req,
48 uint16_t root_dir_fid,
49 struct smb_filename *smb_fname,
51 uint32_t share_access,
52 uint32_t create_disposition,
53 uint32_t create_options,
54 uint32_t file_attributes,
55 uint32_t oplock_request,
56 uint64_t allocation_size,
57 struct security_descriptor *sd,
58 struct ea_list *ea_list,
59 files_struct **result,
62 int onefs_close(vfs_handle_struct *handle, struct files_struct *fsp);
64 int onefs_rename(vfs_handle_struct *handle, const char *oldname,
67 int onefs_stat(vfs_handle_struct *handle, const char *fname,
68 SMB_STRUCT_STAT *sbuf);
70 int onefs_fstat(vfs_handle_struct *handle, struct files_struct *fsp,
71 SMB_STRUCT_STAT *sbuf);
73 int onefs_lstat(vfs_handle_struct *handle, const char *path,
74 SMB_STRUCT_STAT *sbuf);
76 int onefs_unlink(vfs_handle_struct *handle, const char *path);
78 int onefs_chflags(vfs_handle_struct *handle, const char *path,
81 NTSTATUS onefs_streaminfo(vfs_handle_struct *handle,
82 struct files_struct *fsp,
85 unsigned int *num_streams,
86 struct stream_struct **streams);
88 int onefs_vtimes_streams(vfs_handle_struct *handle, const char *fname,
89 int flags, struct timespec times[3]);
91 NTSTATUS onefs_brl_lock_windows(vfs_handle_struct *handle,
92 struct byte_range_lock *br_lck,
93 struct lock_struct *plock,
95 struct blocking_lock_record *blr);
97 bool onefs_brl_unlock_windows(vfs_handle_struct *handle,
98 struct messaging_context *msg_ctx,
99 struct byte_range_lock *br_lck,
100 const struct lock_struct *plock);
102 bool onefs_brl_cancel_windows(vfs_handle_struct *handle,
103 struct byte_range_lock *br_lck,
104 struct lock_struct *plock,
105 struct blocking_lock_record *blr);
107 bool onefs_strict_lock(vfs_handle_struct *handle,
109 struct lock_struct *plock);
111 void onefs_strict_unlock(vfs_handle_struct *handle,
113 struct lock_struct *plock);
115 NTSTATUS onefs_notify_watch(vfs_handle_struct *vfs_handle,
116 struct sys_notify_context *ctx,
117 struct notify_entry *e,
118 void (*callback)(struct sys_notify_context *ctx,
120 struct notify_event *ev),
124 NTSTATUS onefs_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
125 uint32 security_info, SEC_DESC **ppdesc);
127 NTSTATUS onefs_get_nt_acl(vfs_handle_struct *handle, const char* name,
128 uint32 security_info, SEC_DESC **ppdesc);
130 NTSTATUS onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
131 uint32 security_info_sent, SEC_DESC *psd);
136 struct ifs_security_descriptor;
137 NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, SEC_DESC *psd,
138 struct ifs_security_descriptor *sd, int snum,
139 uint32_t *security_info_effective);
141 NTSTATUS onefs_split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
142 char **pbase, char **pstream);
144 int onefs_rdp_add_dir_state(connection_struct *conn, SMB_STRUCT_DIR *dirp);
149 int onefs_sys_create_file(connection_struct *conn,
152 uint32_t access_mask,
153 uint32_t open_access_mask,
154 uint32_t share_access,
155 uint32_t create_options,
160 struct security_descriptor *sd,
162 int *granted_oplock);
164 ssize_t onefs_sys_sendfile(connection_struct *conn, int tofd, int fromfd,
165 const DATA_BLOB *header, SMB_OFF_T offset,
168 ssize_t onefs_sys_recvfile(int fromfd, int tofd, SMB_OFF_T offset,
171 void init_stat_ex_from_onefs_stat(struct stat_ex *dst, const struct stat *src);
173 int onefs_sys_stat(const char *fname, SMB_STRUCT_STAT *sbuf);
175 int onefs_sys_fstat(int fd, SMB_STRUCT_STAT *sbuf);
177 int onefs_sys_fstat_at(int base_fd, const char *fname, SMB_STRUCT_STAT *sbuf,
180 int onefs_sys_lstat(const char *fname, SMB_STRUCT_STAT *sbuf);
184 #endif /* _ONEFS_H */