Changeset 988 for vendor/current/source3/include/vfs.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/vfs.h
r740 r988 7 7 Copyright (C) Stefan (metze) Metzmacher 2003 8 8 Copyright (C) Volker Lendecke 2009 9 9 10 10 This program is free software; you can redistribute it and/or modify 11 11 it under the terms of the GNU General Public License as published by 12 12 the Free Software Foundation; either version 3 of the License, or 13 13 (at your option) any later version. 14 14 15 15 This program is distributed in the hope that it will be useful, 16 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 18 GNU General Public License for more details. 19 19 20 20 You should have received a copy of the GNU General Public License 21 21 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 135 135 /* Leave at 28 - not yet released. Add fdopendir. JRA. */ 136 136 /* Leave at 28 - not yet released. Rename open function to open_fn. - gd */ 137 #define SMB_VFS_INTERFACE_VERSION 28 137 /* Leave at 28 - not yet released. Make getwd function always return malloced memory. JRA. */ 138 /* Bump to version 29 - Samba 3.6.0 will ship with interface version 28. */ 139 /* Leave at 29 - not yet releases. Add fsctl. Richard Sharpe */ 140 /* Leave at 29 - not yet released. add SMB_VFS_GET_DFS_REFERRAL() - metze */ 141 /* Leave at 29 - not yet released. Remove l{list,get,set,remove}xattr - abartlet */ 142 /* Leave at 29 - not yet released. move to plain off_t - abartlet */ 143 /* Leave at 29 - not yet released. Remove sys_acl functions other than set and get - abartlet */ 144 /* Leave at 29 - not yet released. Added backup_intent bool to files_struct - JRA */ 145 /* Leave at 29 - not yet released. Add durable handle functions - metze/obnox */ 146 /* Leave at 29 - not yet released. Added sys_acl_blob_get_file and sys_acl_blob_get_fd */ 147 /* Bump to version 30 - Samba 4.0.0 will ship with interface version 30 */ 148 /* Leave at 30 - not yet released. Added conn->cwd to save vfs_GetWd() calls. */ 149 /* Leave at 30 - not yet released. Changed sys_acl_blob_get_file interface to remove type */ 150 /* Bump to version 31 - Samba 4.1.0 will ship with interface version 31 */ 151 /* Leave at 31 - not yet released. Make struct vuid_cache_entry in 152 connection_struct a pointer. */ 153 /* Leave at 31 - not yet released. Add share_access to vuid_cache_entry. */ 154 /* Leave at 31 - not yet released. add SMB_VFS_COPY_CHUNK() */ 155 /* Leave at 31 - not yet released. Remove the unused 156 fsp->pending_break_messages array */ 157 /* Leave at 31 - not yet released. add SMB_VFS_[GET/SET]_COMPRESSION() */ 158 159 /* Bump to version 32 - Samba 4.2 will ship with that. */ 160 /* Version 32 - Add "lease" to CREATE_FILE operation */ 161 /* Version 32 - Add "lease" to struct files_struct */ 162 /* Version 32 - Add SMB_VFS_READDIR_ATTR() */ 163 /* Version 32 - Add in and out create context blobs to create_file */ 164 /* Version 32 - Remove unnecessary SMB_VFS_DISK_FREE() small_query parameter */ 165 /* Bump to version 33 - Samba 4.3 will ship with that. */ 166 /* Version 33 - change fallocate mode flags param from enum->uint32_t */ 167 /* Version 33 - Add snapshot create/delete calls */ 168 /* Version 33 - Add OS X SMB2 AAPL copyfile extension flag to fsp */ 169 /* Version 33 - Remove notify_watch_fn */ 170 /* Bump to version 34 - Samba 4.4 will ship with that */ 171 /* Version 34 - Remove bool posix_open, add uint64_t posix_flags */ 172 /* Version 34 - Added bool posix_pathnames to struct smb_request */ 173 174 #define SMB_VFS_INTERFACE_VERSION 34 138 175 139 176 /* … … 155 192 struct blocking_lock_record; 156 193 struct smb_filename; 157 158 #define VFS_FIND(__fn__) while (handle->fns->__fn__==NULL) { \ 194 struct dfs_GetDFSReferral; 195 196 typedef union unid_t { 197 uid_t uid; 198 gid_t gid; 199 } unid_t; 200 201 struct fd_handle { 202 size_t ref_count; 203 int fd; 204 uint64_t position_information; 205 off_t pos; 206 uint32_t private_options; /* NT Create options, but we only look at 207 * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and 208 * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB and 209 * NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 210 * for print files *only*, where 211 * DELETE_ON_CLOSE is not stored in the share 212 * mode database. 213 */ 214 unsigned long gen_id; 215 }; 216 217 struct fsp_lease { 218 size_t ref_count; 219 struct smbd_server_connection *sconn; 220 struct tevent_timer *timeout; 221 struct smb2_lease lease; 222 }; 223 224 typedef struct files_struct { 225 struct files_struct *next, *prev; 226 uint64_t fnum; 227 struct smbXsrv_open *op; 228 struct connection_struct *conn; 229 struct fd_handle *fh; 230 unsigned int num_smb_operations; 231 struct file_id file_id; 232 uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */ 233 uint16_t file_pid; 234 uint64_t vuid; /* SMB2 compat */ 235 struct write_cache *wcp; 236 struct timeval open_time; 237 uint32_t access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */ 238 uint32_t share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */ 239 240 bool update_write_time_triggered; 241 struct tevent_timer *update_write_time_event; 242 bool update_write_time_on_close; 243 struct timespec close_write_time; 244 bool write_time_forced; 245 246 int oplock_type; 247 struct fsp_lease *lease; /* Not yet used. Placeholder for leases. */ 248 int sent_oplock_break; 249 struct tevent_timer *oplock_timeout; 250 struct lock_struct last_lock_failure; 251 int current_lock_count; /* Count the number of outstanding locks and pending locks. */ 252 253 bool can_lock; 254 bool can_read; 255 bool can_write; 256 bool modified; 257 bool is_directory; 258 bool aio_write_behind; 259 bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */ 260 bool delete_on_close; 261 uint64_t posix_flags; 262 bool is_sparse; 263 bool backup_intent; /* Handle was successfully opened with backup intent 264 and opener has privilege to do so. */ 265 bool aapl_copyfile_supported; 266 struct smb_filename *fsp_name; 267 uint32_t name_hash; /* Jenkins hash of full pathname. */ 268 uint64_t mid; /* Mid of the operation that created us. */ 269 270 struct vfs_fsp_data *vfs_extension; 271 struct fake_file_handle *fake_file_handle; 272 273 struct notify_change_buf *notify; 274 275 struct files_struct *base_fsp; /* placeholder for delete on close */ 276 277 /* 278 * Read-only cached brlock record, thrown away when the 279 * brlock.tdb seqnum changes. This avoids fetching data from 280 * the brlock.tdb on every read/write call. 281 */ 282 int brlock_seqnum; 283 struct byte_range_lock *brlock_rec; 284 285 struct dptr_struct *dptr; 286 287 /* if not NULL, means this is a print file */ 288 struct print_file_data *print_file; 289 290 unsigned num_aio_requests; 291 struct tevent_req **aio_requests; 292 293 /* 294 * If a close request comes in while we still have aio_requests 295 * around, we need to hold back the close. When all aio_requests are 296 * done, the aio completion routines need tevent_wait_done() on 297 * this. A bit ugly, but before we have close_file() fully async 298 * possibly the simplest approach. Thanks, Jeremy for the idea. 299 */ 300 struct tevent_req *deferred_close; 301 } files_struct; 302 303 #define FSP_POSIX_FLAGS_OPEN 0x01 304 #define FSP_POSIX_FLAGS_RENAME 0x02 305 #define FSP_POSIX_FLAGS_PATHNAMES 0x04 306 307 #define FSP_POSIX_FLAGS_ALL \ 308 (FSP_POSIX_FLAGS_OPEN | \ 309 FSP_POSIX_FLAGS_PATHNAMES | \ 310 FSP_POSIX_FLAGS_RENAME) 311 312 struct vuid_cache_entry { 313 struct auth_session_info *session_info; 314 uint64_t vuid; /* SMB2 compat */ 315 bool read_only; 316 uint32_t share_access; 317 }; 318 319 struct vuid_cache { 320 unsigned int next_entry; 321 struct vuid_cache_entry array[VUID_CACHE_SIZE]; 322 }; 323 324 typedef struct { 325 char *name; 326 bool is_wild; 327 } name_compare_entry; 328 329 struct dfree_cached_info { 330 time_t last_dfree_time; 331 uint64_t dfree_ret; 332 uint64_t bsize; 333 uint64_t dfree; 334 uint64_t dsize; 335 }; 336 337 struct share_params { 338 int service; 339 }; 340 341 typedef struct connection_struct { 342 struct connection_struct *next, *prev; 343 struct smbd_server_connection *sconn; /* can be NULL */ 344 struct smbXsrv_tcon *tcon; /* can be NULL */ 345 uint32_t cnum; /* an index passed over the wire */ 346 struct share_params *params; 347 bool force_user; 348 struct vuid_cache *vuid_cache; 349 bool printer; 350 bool ipc; 351 bool read_only; /* Attributes for the current user of the share. */ 352 uint32_t share_access; 353 /* Does this filesystem honor 354 sub second timestamps on files 355 and directories when setting time ? */ 356 enum timestamp_set_resolution ts_res; 357 char *connectpath; 358 char *origpath; 359 char *cwd; /* Working directory. */ 360 361 struct vfs_handle_struct *vfs_handles; /* for the new plugins */ 362 363 /* 364 * This represents the user information on this connection. Depending 365 * on the vuid using this tid, this might change per SMB request. 366 */ 367 struct auth_session_info *session_info; 368 369 /* 370 * If the "force group" parameter is set, this is the primary gid that 371 * may be used in the users token, depending on the vuid using this tid. 372 */ 373 gid_t force_group_gid; 374 375 uint64_t vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ 376 377 time_t lastused; 378 time_t lastused_count; 379 int num_files_open; 380 unsigned int num_smb_operations; /* Count of smb operations on this tree. */ 381 int encrypt_level; 382 bool encrypted_tid; 383 384 /* Semantics requested by the client or forced by the server config. */ 385 bool case_sensitive; 386 bool case_preserve; 387 bool short_case_preserve; 388 389 /* Semantics provided by the underlying filesystem. */ 390 int fs_capabilities; 391 /* Device number of the directory of the share mount. 392 Used to ensure unique FileIndex returns. */ 393 SMB_DEV_T base_share_dev; 394 395 name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ 396 name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ 397 name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ 398 name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ 399 struct dfree_cached_info *dfree_info; 400 struct trans_state *pending_trans; 401 402 struct rpc_pipe_client *spoolss_pipe; 403 404 } connection_struct; 405 406 struct smbd_smb2_request; 407 struct privilege_paths; 408 409 struct smb_request { 410 uint8_t cmd; 411 uint16_t flags2; 412 uint16_t smbpid; 413 uint64_t mid; /* For compatibility with SMB2. */ 414 uint32_t seqnum; 415 uint64_t vuid; /* For compatibility with SMB2. */ 416 uint32_t tid; 417 uint8_t wct; 418 const uint16_t *vwv; 419 uint16_t buflen; 420 const uint8_t *buf; 421 const uint8_t *inbuf; 422 423 /* 424 * Async handling in the main smb processing loop is directed by 425 * outbuf: reply_xxx routines indicate sync behaviour by putting their 426 * reply into "outbuf". If they leave it as NULL, they take care of it 427 * themselves, possibly later. 428 * 429 * If async handling is wanted, the reply_xxx routine must make sure 430 * that it talloc_move()s the smb_req somewhere else. 431 */ 432 uint8_t *outbuf; 433 434 size_t unread_bytes; 435 bool encrypted; 436 connection_struct *conn; 437 struct smbd_server_connection *sconn; 438 struct smbXsrv_connection *xconn; 439 struct smb_perfcount_data pcd; 440 441 /* 442 * Chained request handling 443 */ 444 struct files_struct *chain_fsp; 445 446 /* 447 * state information for async smb handling 448 */ 449 void *async_priv; 450 451 /* 452 * Back pointer to smb2 request. 453 */ 454 struct smbd_smb2_request *smb2req; 455 456 /* 457 * Pathnames used if request done 458 * under privilege. 459 */ 460 struct privilege_paths *priv_paths; 461 462 /* 463 * Request list for chained requests, we're part of it. 464 */ 465 struct smb_request **chain; 466 467 struct timeval request_time; 468 469 bool posix_pathnames; 470 }; 471 472 /* 473 * Info about an alternate data stream 474 */ 475 476 struct stream_struct { 477 off_t size; 478 off_t alloc_size; 479 char *name; 480 }; 481 482 /* time info */ 483 struct smb_file_time { 484 struct timespec mtime; 485 struct timespec atime; 486 struct timespec ctime; 487 struct timespec create_time; 488 }; 489 490 /* 491 * smb_filename 492 */ 493 struct smb_filename { 494 char *base_name; 495 char *stream_name; 496 char *original_lcomp; 497 SMB_STRUCT_STAT st; 498 }; 499 500 #define VFS_FIND(__fn__) while (handle->fns->__fn__##_fn==NULL) { \ 159 501 handle = handle->next; \ 160 502 } … … 165 507 }; 166 508 167 enum vfs_fallocate_ mode{168 VFS_FALLOCATE_ EXTEND_SIZE = 0,169 VFS_FALLOCATE_ KEEP_SIZE = 1509 enum vfs_fallocate_flags { 510 VFS_FALLOCATE_FL_KEEP_SIZE = 0x0001, 511 VFS_FALLOCATE_FL_PUNCH_HOLE = 0x0002, 170 512 }; 171 513 … … 182 524 183 525 int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user); 184 void (*disconnect )(struct vfs_handle_struct *handle);185 uint64_t (*disk_free )(struct vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,526 void (*disconnect_fn)(struct vfs_handle_struct *handle); 527 uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle, const char *path, uint64_t *bsize, 186 528 uint64_t *dfree, uint64_t *dsize); 187 int (*get_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); 188 int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); 189 int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels); 190 int (*statvfs)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); 191 uint32_t (*fs_capabilities)(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res); 529 int (*get_quota_fn)(struct vfs_handle_struct *handle, const char *path, 530 enum SMB_QUOTA_TYPE qtype, unid_t id, 531 SMB_DISK_QUOTA *qt); 532 int (*set_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); 533 int (*get_shadow_copy_data_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels); 534 int (*statvfs_fn)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); 535 uint32_t (*fs_capabilities_fn)(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res); 536 537 /* 538 * Note: that "struct dfs_GetDFSReferral *r" 539 * needs to be a valid TALLOC_CTX 540 */ 541 NTSTATUS (*get_dfs_referrals_fn)(struct vfs_handle_struct *handle, 542 struct dfs_GetDFSReferral *r); 192 543 193 544 /* Directory operations */ 194 545 195 SMB_STRUCT_DIR *(*opendir)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32attributes);196 SMB_STRUCT_DIR *(*fdopendir)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32attributes);197 SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle,198 SMB_STRUCT_DIR *dirp,199 200 void (*seekdir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset);201 long (*telldir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);202 void (*rewind_dir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);203 int (*mkdir )(struct vfs_handle_struct *handle, const char *path, mode_t mode);204 int (*rmdir )(struct vfs_handle_struct *handle, const char *path);205 int (*closedir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);206 void (*init_search_op )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);546 DIR *(*opendir_fn)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32_t attributes); 547 DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attributes); 548 struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle, 549 DIR *dirp, 550 SMB_STRUCT_STAT *sbuf); 551 void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset); 552 long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp); 553 void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp); 554 int (*mkdir_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode); 555 int (*rmdir_fn)(struct vfs_handle_struct *handle, const char *path); 556 int (*closedir_fn)(struct vfs_handle_struct *handle, DIR *dir); 557 void (*init_search_op_fn)(struct vfs_handle_struct *handle, DIR *dirp); 207 558 208 559 /* File operations */ … … 211 562 struct smb_filename *smb_fname, files_struct *fsp, 212 563 int flags, mode_t mode); 213 NTSTATUS (*create_file)(struct vfs_handle_struct *handle, 214 struct smb_request *req, 215 uint16_t root_dir_fid, 216 struct smb_filename *smb_fname, 217 uint32_t access_mask, 218 uint32_t share_access, 219 uint32_t create_disposition, 220 uint32_t create_options, 221 uint32_t file_attributes, 222 uint32_t oplock_request, 223 uint64_t allocation_size, 224 uint32_t private_flags, 225 struct security_descriptor *sd, 226 struct ea_list *ea_list, 227 files_struct **result, 228 int *pinfo); 564 NTSTATUS (*create_file_fn)(struct vfs_handle_struct *handle, 565 struct smb_request *req, 566 uint16_t root_dir_fid, 567 struct smb_filename *smb_fname, 568 uint32_t access_mask, 569 uint32_t share_access, 570 uint32_t create_disposition, 571 uint32_t create_options, 572 uint32_t file_attributes, 573 uint32_t oplock_request, 574 struct smb2_lease *lease, 575 uint64_t allocation_size, 576 uint32_t private_flags, 577 struct security_descriptor *sd, 578 struct ea_list *ea_list, 579 files_struct **result, 580 int *pinfo, 581 const struct smb2_create_blobs *in_context_blobs, 582 struct smb2_create_blobs *out_context_blobs); 229 583 int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); 230 ssize_t (*vfs_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); 231 ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset); 232 ssize_t (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n); 233 ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset); 234 SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence); 235 ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); 236 ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count); 237 int (*rename)(struct vfs_handle_struct *handle, 238 const struct smb_filename *smb_fname_src, 239 const struct smb_filename *smb_fname_dst); 240 int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp); 241 int (*stat)(struct vfs_handle_struct *handle, struct smb_filename *smb_fname); 242 int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); 243 int (*lstat)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename); 244 uint64_t (*get_alloc_size)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf); 245 int (*unlink)(struct vfs_handle_struct *handle, 246 const struct smb_filename *smb_fname); 247 int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode); 248 int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 249 int (*chown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 250 int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); 251 int (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 252 int (*chdir)(struct vfs_handle_struct *handle, const char *path); 253 char *(*getwd)(struct vfs_handle_struct *handle, char *buf); 254 int (*ntimes)(struct vfs_handle_struct *handle, 255 const struct smb_filename *smb_fname, 256 struct smb_file_time *ft); 257 int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset); 258 int (*fallocate)(struct vfs_handle_struct *handle, 259 struct files_struct *fsp, 260 enum vfs_fallocate_mode mode, 261 SMB_OFF_T offset, 262 SMB_OFF_T len); 263 bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); 264 int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, 265 uint32 share_mode, uint32_t access_mask); 266 int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); 267 bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); 268 int (*symlink)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 269 int (*vfs_readlink)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); 270 int (*link)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 271 int (*mknod)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); 272 char *(*realpath)(struct vfs_handle_struct *handle, const char *path); 273 NTSTATUS (*notify_watch)(struct vfs_handle_struct *handle, 274 struct sys_notify_context *ctx, 275 struct notify_entry *e, 276 void (*callback)(struct sys_notify_context *ctx, 277 void *private_data, 278 struct notify_event *ev), 279 void *private_data, void *handle_p); 280 int (*chflags)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); 281 struct file_id (*file_id_create)(struct vfs_handle_struct *handle, 282 const SMB_STRUCT_STAT *sbuf); 283 284 NTSTATUS (*streaminfo)(struct vfs_handle_struct *handle, 584 ssize_t (*read_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); 585 ssize_t (*pread_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset); 586 struct tevent_req *(*pread_send_fn)(struct vfs_handle_struct *handle, 587 TALLOC_CTX *mem_ctx, 588 struct tevent_context *ev, 589 struct files_struct *fsp, 590 void *data, 591 size_t n, off_t offset); 592 ssize_t (*pread_recv_fn)(struct tevent_req *req, int *err); 593 ssize_t (*write_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n); 594 ssize_t (*pwrite_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, off_t offset); 595 struct tevent_req *(*pwrite_send_fn)(struct vfs_handle_struct *handle, 596 TALLOC_CTX *mem_ctx, 597 struct tevent_context *ev, 598 struct files_struct *fsp, 599 const void *data, 600 size_t n, off_t offset); 601 ssize_t (*pwrite_recv_fn)(struct tevent_req *req, int *err); 602 off_t (*lseek_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset, int whence); 603 ssize_t (*sendfile_fn)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, off_t offset, size_t count); 604 ssize_t (*recvfile_fn)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t count); 605 int (*rename_fn)(struct vfs_handle_struct *handle, 606 const struct smb_filename *smb_fname_src, 607 const struct smb_filename *smb_fname_dst); 608 int (*fsync_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); 609 struct tevent_req *(*fsync_send_fn)(struct vfs_handle_struct *handle, 610 TALLOC_CTX *mem_ctx, 611 struct tevent_context *ev, 612 struct files_struct *fsp); 613 int (*fsync_recv_fn)(struct tevent_req *req, int *err); 614 int (*stat_fn)(struct vfs_handle_struct *handle, struct smb_filename *smb_fname); 615 int (*fstat_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); 616 int (*lstat_fn)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename); 617 uint64_t (*get_alloc_size_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf); 618 int (*unlink_fn)(struct vfs_handle_struct *handle, 619 const struct smb_filename *smb_fname); 620 int (*chmod_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode); 621 int (*fchmod_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 622 int (*chown_fn)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 623 int (*fchown_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); 624 int (*lchown_fn)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 625 int (*chdir_fn)(struct vfs_handle_struct *handle, const char *path); 626 char *(*getwd_fn)(struct vfs_handle_struct *handle); 627 int (*ntimes_fn)(struct vfs_handle_struct *handle, 628 const struct smb_filename *smb_fname, 629 struct smb_file_time *ft); 630 int (*ftruncate_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset); 631 int (*fallocate_fn)(struct vfs_handle_struct *handle, 632 struct files_struct *fsp, 633 uint32_t mode, 634 off_t offset, 635 off_t len); 636 bool (*lock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, off_t offset, off_t count, int type); 637 int (*kernel_flock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, 638 uint32_t share_mode, uint32_t access_mask); 639 int (*linux_setlease_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); 640 bool (*getlock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid); 641 int (*symlink_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 642 int (*readlink_fn)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); 643 int (*link_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 644 int (*mknod_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); 645 char *(*realpath_fn)(struct vfs_handle_struct *handle, const char *path); 646 int (*chflags_fn)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); 647 struct file_id (*file_id_create_fn)(struct vfs_handle_struct *handle, 648 const SMB_STRUCT_STAT *sbuf); 649 struct tevent_req *(*copy_chunk_send_fn)(struct vfs_handle_struct *handle, 650 TALLOC_CTX *mem_ctx, 651 struct tevent_context *ev, 652 struct files_struct *src_fsp, 653 off_t src_off, 654 struct files_struct *dest_fsp, 655 off_t dest_off, 656 off_t num); 657 NTSTATUS (*copy_chunk_recv_fn)(struct vfs_handle_struct *handle, 658 struct tevent_req *req, 659 off_t *copied); 660 NTSTATUS (*get_compression_fn)(struct vfs_handle_struct *handle, 661 TALLOC_CTX *mem_ctx, 662 struct files_struct *fsp, 663 struct smb_filename *smb_fname, 664 uint16_t *_compression_fmt); 665 NTSTATUS (*set_compression_fn)(struct vfs_handle_struct *handle, 666 TALLOC_CTX *mem_ctx, 667 struct files_struct *fsp, 668 uint16_t compression_fmt); 669 NTSTATUS (*snap_check_path_fn)(struct vfs_handle_struct *handle, 670 TALLOC_CTX *mem_ctx, 671 const char *service_path, 672 char **base_volume); 673 NTSTATUS (*snap_create_fn)(struct vfs_handle_struct *handle, 674 TALLOC_CTX *mem_ctx, 675 const char *base_volume, 676 time_t *tstamp, 677 bool rw, 678 char **base_path, 679 char **snap_path); 680 NTSTATUS (*snap_delete_fn)(struct vfs_handle_struct *handle, 681 TALLOC_CTX *mem_ctx, 682 char *base_path, 683 char *snap_path); 684 685 NTSTATUS (*streaminfo_fn)(struct vfs_handle_struct *handle, 686 struct files_struct *fsp, 687 const char *fname, 688 TALLOC_CTX *mem_ctx, 689 unsigned int *num_streams, 690 struct stream_struct **streams); 691 692 int (*get_real_filename_fn)(struct vfs_handle_struct *handle, 693 const char *path, 694 const char *name, 695 TALLOC_CTX *mem_ctx, 696 char **found_name); 697 698 const char *(*connectpath_fn)(struct vfs_handle_struct *handle, 699 const char *filename); 700 701 NTSTATUS (*brl_lock_windows_fn)(struct vfs_handle_struct *handle, 702 struct byte_range_lock *br_lck, 703 struct lock_struct *plock, 704 bool blocking_lock); 705 706 bool (*brl_unlock_windows_fn)(struct vfs_handle_struct *handle, 707 struct messaging_context *msg_ctx, 708 struct byte_range_lock *br_lck, 709 const struct lock_struct *plock); 710 711 bool (*brl_cancel_windows_fn)(struct vfs_handle_struct *handle, 712 struct byte_range_lock *br_lck, 713 struct lock_struct *plock); 714 715 bool (*strict_lock_fn)(struct vfs_handle_struct *handle, 285 716 struct files_struct *fsp, 286 const char *fname, 287 TALLOC_CTX *mem_ctx, 288 unsigned int *num_streams, 289 struct stream_struct **streams); 290 291 int (*get_real_filename)(struct vfs_handle_struct *handle, 292 const char *path, 293 const char *name, 294 TALLOC_CTX *mem_ctx, 295 char **found_name); 296 297 const char *(*connectpath)(struct vfs_handle_struct *handle, 298 const char *filename); 299 300 NTSTATUS (*brl_lock_windows)(struct vfs_handle_struct *handle, 301 struct byte_range_lock *br_lck, 302 struct lock_struct *plock, 303 bool blocking_lock, 304 struct blocking_lock_record *blr); 305 306 bool (*brl_unlock_windows)(struct vfs_handle_struct *handle, 307 struct messaging_context *msg_ctx, 308 struct byte_range_lock *br_lck, 309 const struct lock_struct *plock); 310 311 bool (*brl_cancel_windows)(struct vfs_handle_struct *handle, 312 struct byte_range_lock *br_lck, 313 struct lock_struct *plock, 314 struct blocking_lock_record *blr); 315 316 bool (*strict_lock)(struct vfs_handle_struct *handle, 317 struct files_struct *fsp, 318 struct lock_struct *plock); 319 320 void (*strict_unlock)(struct vfs_handle_struct *handle, 321 struct files_struct *fsp, 322 struct lock_struct *plock); 323 324 NTSTATUS (*translate_name)(struct vfs_handle_struct *handle, 325 const char *name, 326 enum vfs_translate_direction direction, 717 struct lock_struct *plock); 718 719 void (*strict_unlock_fn)(struct vfs_handle_struct *handle, 720 struct files_struct *fsp, 721 struct lock_struct *plock); 722 723 NTSTATUS (*translate_name_fn)(struct vfs_handle_struct *handle, 724 const char *name, 725 enum vfs_translate_direction direction, 726 TALLOC_CTX *mem_ctx, 727 char **mapped_name); 728 729 NTSTATUS (*fsctl_fn)(struct vfs_handle_struct *handle, 730 struct files_struct *fsp, 731 TALLOC_CTX *ctx, 732 uint32_t function, 733 uint16_t req_flags, 734 const uint8_t *_in_data, 735 uint32_t in_len, 736 uint8_t **_out_data, 737 uint32_t max_out_len, 738 uint32_t *out_len); 739 740 /* NT ACL operations. */ 741 742 NTSTATUS (*fget_nt_acl_fn)(struct vfs_handle_struct *handle, 743 struct files_struct *fsp, 744 uint32_t security_info, 327 745 TALLOC_CTX *mem_ctx, 328 char **mapped_name);329 330 /* NT ACL operations. */331 332 NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,333 struct files_struct *fsp,334 uint32 security_info,335 struct security_descriptor **ppdesc);336 NTSTATUS (*get_nt_acl)(struct vfs_handle_struct *handle,337 const char *name,338 uint32 security_info, 339 struct security_descriptor **ppdesc);340 NTSTATUS (*fset_nt_acl)(struct vfs_handle_struct *handle,341 struct files_struct *fsp,342 uint32 security_info_sent,343 const struct security_descriptor *psd);746 struct security_descriptor **ppdesc); 747 NTSTATUS (*get_nt_acl_fn)(struct vfs_handle_struct *handle, 748 const char *name, 749 uint32_t security_info, 750 TALLOC_CTX *mem_ctx, 751 struct security_descriptor **ppdesc); 752 NTSTATUS (*fset_nt_acl_fn)(struct vfs_handle_struct *handle, 753 struct files_struct *fsp, 754 uint32_t security_info_sent, 755 const struct security_descriptor *psd); 756 757 NTSTATUS (*audit_file_fn)(struct vfs_handle_struct *handle, 758 struct smb_filename *file, 759 struct security_acl *sacl, 760 uint32_t access_requested, 761 uint32_t access_denied); 344 762 345 763 /* POSIX ACL operations. */ 346 764 347 int (*chmod_acl)(struct vfs_handle_struct *handle, const char *name, mode_t mode); 348 int (*fchmod_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 349 350 int (*sys_acl_get_entry)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); 351 int (*sys_acl_get_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); 352 int (*sys_acl_get_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); 353 void * (*sys_acl_get_qualifier)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d); 354 SMB_ACL_T (*sys_acl_get_file)(struct vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type); 355 SMB_ACL_T (*sys_acl_get_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp); 356 int (*sys_acl_clear_perms)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset); 357 int (*sys_acl_add_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); 358 char * (*sys_acl_to_text)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen); 359 SMB_ACL_T (*sys_acl_init)(struct vfs_handle_struct *handle, int count); 360 int (*sys_acl_create_entry)(struct vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); 361 int (*sys_acl_set_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); 362 int (*sys_acl_set_qualifier)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual); 363 int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); 364 int (*sys_acl_valid)(struct vfs_handle_struct *handle, SMB_ACL_T theacl ); 365 int (*sys_acl_set_file)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); 366 int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl); 367 int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, const char *path); 368 int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); 369 int (*sys_acl_free_text)(struct vfs_handle_struct *handle, char *text); 370 int (*sys_acl_free_acl)(struct vfs_handle_struct *handle, SMB_ACL_T posix_acl); 371 int (*sys_acl_free_qualifier)(struct vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype); 765 int (*chmod_acl_fn)(struct vfs_handle_struct *handle, const char *name, mode_t mode); 766 int (*fchmod_acl_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 767 768 SMB_ACL_T (*sys_acl_get_file_fn)(struct vfs_handle_struct *handle, 769 const char *path_p, 770 SMB_ACL_TYPE_T type, 771 TALLOC_CTX *mem_ctx); 772 SMB_ACL_T (*sys_acl_get_fd_fn)(struct vfs_handle_struct *handle, 773 struct files_struct *fsp, 774 TALLOC_CTX *mem_ctx); 775 int (*sys_acl_blob_get_file_fn)(struct vfs_handle_struct *handle, 776 const char *path_p, 777 TALLOC_CTX *mem_ctx, 778 char **blob_description, 779 DATA_BLOB *blob); 780 int (*sys_acl_blob_get_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, 781 TALLOC_CTX *mem_ctx, char **blob_description, 782 DATA_BLOB *blob); 783 int (*sys_acl_set_file_fn)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); 784 int (*sys_acl_set_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl); 785 int (*sys_acl_delete_def_file_fn)(struct vfs_handle_struct *handle, const char *path); 372 786 373 787 /* EA operations. */ 374 ssize_t (*getxattr)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); 375 ssize_t (*lgetxattr)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); 376 ssize_t (*fgetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size); 377 ssize_t (*listxattr)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); 378 ssize_t (*llistxattr)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); 379 ssize_t (*flistxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); 380 int (*removexattr)(struct vfs_handle_struct *handle, const char *path, const char *name); 381 int (*lremovexattr)(struct vfs_handle_struct *handle, const char *path, const char *name); 382 int (*fremovexattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name); 383 int (*setxattr)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); 384 int (*lsetxattr)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); 385 int (*fsetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags); 788 ssize_t (*getxattr_fn)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); 789 ssize_t (*fgetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size); 790 ssize_t (*listxattr_fn)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); 791 ssize_t (*flistxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); 792 int (*removexattr_fn)(struct vfs_handle_struct *handle, const char *path, const char *name); 793 int (*fremovexattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name); 794 int (*setxattr_fn)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); 795 int (*fsetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags); 386 796 387 797 /* aio operations */ 388 int (*aio_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 389 int (*aio_write)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 390 ssize_t (*aio_return_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 391 int (*aio_cancel)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 392 int (*aio_error_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 393 int (*aio_fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); 394 int (*aio_suspend)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout); 395 bool (*aio_force)(struct vfs_handle_struct *handle, struct files_struct *fsp); 798 bool (*aio_force_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); 396 799 397 800 /* offline operations */ 398 bool (*is_offline )(struct vfs_handle_struct *handle,801 bool (*is_offline_fn)(struct vfs_handle_struct *handle, 399 802 const struct smb_filename *fname, 400 803 SMB_STRUCT_STAT *sbuf); 401 int (*set_offline )(struct vfs_handle_struct *handle,804 int (*set_offline_fn)(struct vfs_handle_struct *handle, 402 805 const struct smb_filename *fname); 806 807 /* durable handle operations */ 808 NTSTATUS (*durable_cookie_fn)(struct vfs_handle_struct *handle, 809 struct files_struct *fsp, 810 TALLOC_CTX *mem_ctx, 811 DATA_BLOB *cookie); 812 NTSTATUS (*durable_disconnect_fn)(struct vfs_handle_struct *handle, 813 struct files_struct *fsp, 814 const DATA_BLOB old_cookie, 815 TALLOC_CTX *mem_ctx, 816 DATA_BLOB *new_cookie); 817 NTSTATUS (*durable_reconnect_fn)(struct vfs_handle_struct *handle, 818 struct smb_request *smb1req, 819 struct smbXsrv_open *op, 820 const DATA_BLOB old_cookie, 821 TALLOC_CTX *mem_ctx, 822 struct files_struct **fsp, 823 DATA_BLOB *new_cookie); 824 825 NTSTATUS (*readdir_attr_fn)(struct vfs_handle_struct *handle, 826 const struct smb_filename *fname, 827 TALLOC_CTX *mem_ctx, 828 struct readdir_attr_data **attr_data); 403 829 }; 404 830 … … 422 848 typedef struct vfs_statvfs_struct { 423 849 /* For undefined recommended transfer size return -1 in that field */ 424 uint32 OptimalTransferSize; /* bsize on some os, iosize on other os */425 uint32 BlockSize;850 uint32_t OptimalTransferSize; /* bsize on some os, iosize on other os */ 851 uint32_t BlockSize; 426 852 427 853 /* … … 506 932 void smb_vfs_call_disconnect(struct vfs_handle_struct *handle); 507 933 uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle, 508 const char *path, bool small_query, 509 uint64_t *bsize, uint64_t *dfree, 510 uint64_t *dsize); 511 int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, 934 const char *path, uint64_t *bsize, 935 uint64_t *dfree, uint64_t *dsize); 936 int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, const char *path, 512 937 enum SMB_QUOTA_TYPE qtype, unid_t id, 513 938 SMB_DISK_QUOTA *qt); … … 522 947 struct vfs_statvfs_struct *statbuf); 523 948 uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct *handle, 524 enum timestamp_set_resolution *p_ts_res); 525 SMB_STRUCT_DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle, 949 enum timestamp_set_resolution *p_ts_res); 950 /* 951 * Note: that "struct dfs_GetDFSReferral *r" needs to be a valid TALLOC_CTX 952 */ 953 NTSTATUS smb_vfs_call_get_dfs_referrals(struct vfs_handle_struct *handle, 954 struct dfs_GetDFSReferral *r); 955 DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle, 526 956 const char *fname, const char *mask, 527 uint32 attributes);528 SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,957 uint32_t attributes); 958 DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle, 529 959 struct files_struct *fsp, 530 960 const char *mask, 531 uint32 attributes);532 SMB_STRUCT_DIRENT*smb_vfs_call_readdir(struct vfs_handle_struct *handle,533 SMB_STRUCT_DIR *dirp,961 uint32_t attributes); 962 struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle, 963 DIR *dirp, 534 964 SMB_STRUCT_STAT *sbuf); 535 965 void smb_vfs_call_seekdir(struct vfs_handle_struct *handle, 536 SMB_STRUCT_DIR *dirp, long offset);966 DIR *dirp, long offset); 537 967 long smb_vfs_call_telldir(struct vfs_handle_struct *handle, 538 SMB_STRUCT_DIR *dirp);968 DIR *dirp); 539 969 void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle, 540 SMB_STRUCT_DIR *dirp);970 DIR *dirp); 541 971 int smb_vfs_call_mkdir(struct vfs_handle_struct *handle, const char *path, 542 972 mode_t mode); 543 973 int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, const char *path); 544 974 int smb_vfs_call_closedir(struct vfs_handle_struct *handle, 545 SMB_STRUCT_DIR *dir);975 DIR *dir); 546 976 void smb_vfs_call_init_search_op(struct vfs_handle_struct *handle, 547 SMB_STRUCT_DIR *dirp);977 DIR *dirp); 548 978 int smb_vfs_call_open(struct vfs_handle_struct *handle, 549 979 struct smb_filename *smb_fname, struct files_struct *fsp, … … 559 989 uint32_t file_attributes, 560 990 uint32_t oplock_request, 991 struct smb2_lease *lease, 561 992 uint64_t allocation_size, 562 993 uint32_t private_flags, … … 564 995 struct ea_list *ea_list, 565 996 files_struct **result, 566 int *pinfo); 567 int smb_vfs_call_close_fn(struct vfs_handle_struct *handle, 568 struct files_struct *fsp); 569 ssize_t smb_vfs_call_vfs_read(struct vfs_handle_struct *handle, 570 struct files_struct *fsp, void *data, size_t n); 997 int *pinfo, 998 const struct smb2_create_blobs *in_context_blobs, 999 struct smb2_create_blobs *out_context_blobs); 1000 int smb_vfs_call_close(struct vfs_handle_struct *handle, 1001 struct files_struct *fsp); 1002 ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle, 1003 struct files_struct *fsp, void *data, size_t n); 571 1004 ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle, 572 1005 struct files_struct *fsp, void *data, size_t n, 573 SMB_OFF_T offset); 1006 off_t offset); 1007 struct tevent_req *smb_vfs_call_pread_send(struct vfs_handle_struct *handle, 1008 TALLOC_CTX *mem_ctx, 1009 struct tevent_context *ev, 1010 struct files_struct *fsp, 1011 void *data, 1012 size_t n, off_t offset); 1013 ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, int *perrno); 1014 574 1015 ssize_t smb_vfs_call_write(struct vfs_handle_struct *handle, 575 1016 struct files_struct *fsp, const void *data, … … 577 1018 ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle, 578 1019 struct files_struct *fsp, const void *data, 579 size_t n, SMB_OFF_T offset); 580 SMB_OFF_T smb_vfs_call_lseek(struct vfs_handle_struct *handle, 581 struct files_struct *fsp, SMB_OFF_T offset, 1020 size_t n, off_t offset); 1021 struct tevent_req *smb_vfs_call_pwrite_send(struct vfs_handle_struct *handle, 1022 TALLOC_CTX *mem_ctx, 1023 struct tevent_context *ev, 1024 struct files_struct *fsp, 1025 const void *data, 1026 size_t n, off_t offset); 1027 ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, int *perrno); 1028 1029 off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle, 1030 struct files_struct *fsp, off_t offset, 582 1031 int whence); 583 1032 ssize_t smb_vfs_call_sendfile(struct vfs_handle_struct *handle, int tofd, 584 1033 files_struct *fromfsp, const DATA_BLOB *header, 585 SMB_OFF_Toffset, size_t count);1034 off_t offset, size_t count); 586 1035 ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd, 587 files_struct *tofsp, SMB_OFF_Toffset,1036 files_struct *tofsp, off_t offset, 588 1037 size_t count); 589 1038 int smb_vfs_call_rename(struct vfs_handle_struct *handle, … … 592 1041 int smb_vfs_call_fsync(struct vfs_handle_struct *handle, 593 1042 struct files_struct *fsp); 1043 1044 struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle, 1045 TALLOC_CTX *mem_ctx, 1046 struct tevent_context *ev, 1047 struct files_struct *fsp); 1048 int SMB_VFS_FSYNC_RECV(struct tevent_req *req, int *perrno); 1049 594 1050 int smb_vfs_call_stat(struct vfs_handle_struct *handle, 595 1051 struct smb_filename *smb_fname); … … 614 1070 uid_t uid, gid_t gid); 615 1071 int smb_vfs_call_chdir(struct vfs_handle_struct *handle, const char *path); 616 char *smb_vfs_call_getwd(struct vfs_handle_struct *handle , char *buf);1072 char *smb_vfs_call_getwd(struct vfs_handle_struct *handle); 617 1073 int smb_vfs_call_ntimes(struct vfs_handle_struct *handle, 618 1074 const struct smb_filename *smb_fname, 619 1075 struct smb_file_time *ft); 620 1076 int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle, 621 struct files_struct *fsp, SMB_OFF_Toffset);1077 struct files_struct *fsp, off_t offset); 622 1078 int smb_vfs_call_fallocate(struct vfs_handle_struct *handle, 623 struct files_struct *fsp,624 enum vfs_fallocate_modemode,625 SMB_OFF_Toffset,626 SMB_OFF_Tlen);1079 struct files_struct *fsp, 1080 uint32_t mode, 1081 off_t offset, 1082 off_t len); 627 1083 bool smb_vfs_call_lock(struct vfs_handle_struct *handle, 628 struct files_struct *fsp, int op, SMB_OFF_Toffset,629 SMB_OFF_Tcount, int type);1084 struct files_struct *fsp, int op, off_t offset, 1085 off_t count, int type); 630 1086 int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle, 631 struct files_struct *fsp, uint32 share_mode,1087 struct files_struct *fsp, uint32_t share_mode, 632 1088 uint32_t access_mask); 633 1089 int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle, 634 1090 struct files_struct *fsp, int leasetype); 635 1091 bool smb_vfs_call_getlock(struct vfs_handle_struct *handle, 636 struct files_struct *fsp, SMB_OFF_T*poffset,637 SMB_OFF_T*pcount, int *ptype, pid_t *ppid);1092 struct files_struct *fsp, off_t *poffset, 1093 off_t *pcount, int *ptype, pid_t *ppid); 638 1094 int smb_vfs_call_symlink(struct vfs_handle_struct *handle, const char *oldpath, 639 1095 const char *newpath); 640 int smb_vfs_call_ vfs_readlink(struct vfs_handle_struct *handle,641 1096 int smb_vfs_call_readlink(struct vfs_handle_struct *handle, 1097 const char *path, char *buf, size_t bufsiz); 642 1098 int smb_vfs_call_link(struct vfs_handle_struct *handle, const char *oldpath, 643 1099 const char *newpath); … … 645 1101 mode_t mode, SMB_DEV_T dev); 646 1102 char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path); 647 NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle,648 struct sys_notify_context *ctx,649 struct notify_entry *e,650 void (*callback)(struct sys_notify_context *ctx,651 void *private_data,652 struct notify_event *ev),653 void *private_data, void *handle_p);654 1103 int smb_vfs_call_chflags(struct vfs_handle_struct *handle, const char *path, 655 1104 unsigned int flags); … … 670 1119 struct byte_range_lock *br_lck, 671 1120 struct lock_struct *plock, 672 bool blocking_lock, 673 struct blocking_lock_record *blr); 1121 bool blocking_lock); 674 1122 bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle, 675 1123 struct messaging_context *msg_ctx, … … 678 1126 bool smb_vfs_call_brl_cancel_windows(struct vfs_handle_struct *handle, 679 1127 struct byte_range_lock *br_lck, 680 struct lock_struct *plock, 681 struct blocking_lock_record *blr); 1128 struct lock_struct *plock); 682 1129 bool smb_vfs_call_strict_lock(struct vfs_handle_struct *handle, 683 1130 struct files_struct *fsp, … … 691 1138 TALLOC_CTX *mem_ctx, 692 1139 char **mapped_name); 1140 NTSTATUS smb_vfs_call_fsctl(struct vfs_handle_struct *handle, 1141 struct files_struct *fsp, 1142 TALLOC_CTX *ctx, 1143 uint32_t function, 1144 uint16_t req_flags, 1145 const uint8_t *_in_data, 1146 uint32_t in_len, 1147 uint8_t **_out_data, 1148 uint32_t max_out_len, 1149 uint32_t *out_len); 1150 struct tevent_req *smb_vfs_call_copy_chunk_send(struct vfs_handle_struct *handle, 1151 TALLOC_CTX *mem_ctx, 1152 struct tevent_context *ev, 1153 struct files_struct *src_fsp, 1154 off_t src_off, 1155 struct files_struct *dest_fsp, 1156 off_t dest_off, 1157 off_t num); 1158 NTSTATUS smb_vfs_call_copy_chunk_recv(struct vfs_handle_struct *handle, 1159 struct tevent_req *req, 1160 off_t *copied); 1161 NTSTATUS smb_vfs_call_get_compression(struct vfs_handle_struct *handle, 1162 TALLOC_CTX *mem_ctx, 1163 struct files_struct *fsp, 1164 struct smb_filename *smb_fname, 1165 uint16_t *_compression_fmt); 1166 NTSTATUS smb_vfs_call_set_compression(struct vfs_handle_struct *handle, 1167 TALLOC_CTX *mem_ctx, 1168 struct files_struct *fsp, 1169 uint16_t compression_fmt); 1170 NTSTATUS smb_vfs_call_snap_check_path(vfs_handle_struct *handle, 1171 TALLOC_CTX *mem_ctx, 1172 const char *service_path, 1173 char **base_volume); 1174 NTSTATUS smb_vfs_call_snap_create(struct vfs_handle_struct *handle, 1175 TALLOC_CTX *mem_ctx, 1176 const char *base_volume, 1177 time_t *tstamp, 1178 bool rw, 1179 char **base_path, 1180 char **snap_path); 1181 NTSTATUS smb_vfs_call_snap_delete(struct vfs_handle_struct *handle, 1182 TALLOC_CTX *mem_ctx, 1183 char *base_path, 1184 char *snap_path); 693 1185 NTSTATUS smb_vfs_call_fget_nt_acl(struct vfs_handle_struct *handle, 694 1186 struct files_struct *fsp, 695 uint32 security_info, 1187 uint32_t security_info, 1188 TALLOC_CTX *mem_ctx, 696 1189 struct security_descriptor **ppdesc); 697 1190 NTSTATUS smb_vfs_call_get_nt_acl(struct vfs_handle_struct *handle, 698 1191 const char *name, 699 uint32 security_info, 1192 uint32_t security_info, 1193 TALLOC_CTX *mem_ctx, 700 1194 struct security_descriptor **ppdesc); 701 1195 NTSTATUS smb_vfs_call_fset_nt_acl(struct vfs_handle_struct *handle, 702 1196 struct files_struct *fsp, 703 uint32 security_info_sent,1197 uint32_t security_info_sent, 704 1198 const struct security_descriptor *psd); 1199 NTSTATUS smb_vfs_call_audit_file(struct vfs_handle_struct *handle, 1200 struct smb_filename *file, 1201 struct security_acl *sacl, 1202 uint32_t access_requested, 1203 uint32_t access_denied); 705 1204 int smb_vfs_call_chmod_acl(struct vfs_handle_struct *handle, const char *name, 706 1205 mode_t mode); 707 1206 int smb_vfs_call_fchmod_acl(struct vfs_handle_struct *handle, 708 1207 struct files_struct *fsp, mode_t mode); 709 int smb_vfs_call_sys_acl_get_entry(struct vfs_handle_struct *handle,710 SMB_ACL_T theacl, int entry_id,711 SMB_ACL_ENTRY_T *entry_p);712 int smb_vfs_call_sys_acl_get_tag_type(struct vfs_handle_struct *handle,713 SMB_ACL_ENTRY_T entry_d,714 SMB_ACL_TAG_T *tag_type_p);715 int smb_vfs_call_sys_acl_get_permset(struct vfs_handle_struct *handle,716 SMB_ACL_ENTRY_T entry_d,717 SMB_ACL_PERMSET_T *permset_p);718 void * smb_vfs_call_sys_acl_get_qualifier(struct vfs_handle_struct *handle,719 SMB_ACL_ENTRY_T entry_d);720 1208 SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle, 721 1209 const char *path_p, 722 SMB_ACL_TYPE_T type); 1210 SMB_ACL_TYPE_T type, 1211 TALLOC_CTX *mem_ctx); 723 1212 SMB_ACL_T smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct *handle, 724 struct files_struct *fsp); 725 int smb_vfs_call_sys_acl_clear_perms(struct vfs_handle_struct *handle, 726 SMB_ACL_PERMSET_T permset); 727 int smb_vfs_call_sys_acl_add_perm(struct vfs_handle_struct *handle, 728 SMB_ACL_PERMSET_T permset, 729 SMB_ACL_PERM_T perm); 730 char * smb_vfs_call_sys_acl_to_text(struct vfs_handle_struct *handle, 731 SMB_ACL_T theacl, ssize_t *plen); 732 SMB_ACL_T smb_vfs_call_sys_acl_init(struct vfs_handle_struct *handle, 733 int count); 734 int smb_vfs_call_sys_acl_create_entry(struct vfs_handle_struct *handle, 735 SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); 736 int smb_vfs_call_sys_acl_set_tag_type(struct vfs_handle_struct *handle, 737 SMB_ACL_ENTRY_T entry, 738 SMB_ACL_TAG_T tagtype); 739 int smb_vfs_call_sys_acl_set_qualifier(struct vfs_handle_struct *handle, 740 SMB_ACL_ENTRY_T entry, void *qual); 741 int smb_vfs_call_sys_acl_set_permset(struct vfs_handle_struct *handle, 742 SMB_ACL_ENTRY_T entry, 743 SMB_ACL_PERMSET_T permset); 744 int smb_vfs_call_sys_acl_valid(struct vfs_handle_struct *handle, 745 SMB_ACL_T theacl); 1213 struct files_struct *fsp, 1214 TALLOC_CTX *mem_ctx); 1215 int smb_vfs_call_sys_acl_blob_get_file(struct vfs_handle_struct *handle, 1216 const char *path_p, 1217 TALLOC_CTX *mem_ctx, 1218 char **blob_description, 1219 DATA_BLOB *blob); 1220 int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle, 1221 struct files_struct *fsp, 1222 TALLOC_CTX *mem_ctx, 1223 char **blob_description, 1224 DATA_BLOB *blob); 746 1225 int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle, 747 1226 const char *name, SMB_ACL_TYPE_T acltype, … … 751 1230 int smb_vfs_call_sys_acl_delete_def_file(struct vfs_handle_struct *handle, 752 1231 const char *path); 753 int smb_vfs_call_sys_acl_get_perm(struct vfs_handle_struct *handle,754 SMB_ACL_PERMSET_T permset,755 SMB_ACL_PERM_T perm);756 int smb_vfs_call_sys_acl_free_text(struct vfs_handle_struct *handle,757 char *text);758 int smb_vfs_call_sys_acl_free_acl(struct vfs_handle_struct *handle,759 SMB_ACL_T posix_acl);760 int smb_vfs_call_sys_acl_free_qualifier(struct vfs_handle_struct *handle,761 void *qualifier, SMB_ACL_TAG_T tagtype);762 1232 ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle, 763 1233 const char *path, const char *name, void *value, 764 1234 size_t size); 765 ssize_t smb_vfs_call_lgetxattr(struct vfs_handle_struct *handle,766 const char *path, const char *name, void *value,767 size_t size);768 1235 ssize_t smb_vfs_call_fgetxattr(struct vfs_handle_struct *handle, 769 1236 struct files_struct *fsp, const char *name, … … 778 1245 int smb_vfs_call_removexattr(struct vfs_handle_struct *handle, 779 1246 const char *path, const char *name); 780 int smb_vfs_call_lremovexattr(struct vfs_handle_struct *handle,781 const char *path, const char *name);782 1247 int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle, 783 1248 struct files_struct *fsp, const char *name); … … 791 1256 struct files_struct *fsp, const char *name, 792 1257 const void *value, size_t size, int flags); 793 int smb_vfs_call_aio_read(struct vfs_handle_struct *handle,794 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);795 int smb_vfs_call_aio_write(struct vfs_handle_struct *handle,796 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);797 ssize_t smb_vfs_call_aio_return_fn(struct vfs_handle_struct *handle,798 struct files_struct *fsp,799 SMB_STRUCT_AIOCB *aiocb);800 int smb_vfs_call_aio_cancel(struct vfs_handle_struct *handle,801 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);802 int smb_vfs_call_aio_error_fn(struct vfs_handle_struct *handle,803 struct files_struct *fsp,804 SMB_STRUCT_AIOCB *aiocb);805 int smb_vfs_call_aio_fsync(struct vfs_handle_struct *handle,806 struct files_struct *fsp, int op,807 SMB_STRUCT_AIOCB *aiocb);808 int smb_vfs_call_aio_suspend(struct vfs_handle_struct *handle,809 struct files_struct *fsp,810 const SMB_STRUCT_AIOCB * const aiocb[], int n,811 const struct timespec *timeout);812 1258 bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle, 813 1259 struct files_struct *fsp); … … 817 1263 int smb_vfs_call_set_offline(struct vfs_handle_struct *handle, 818 1264 const struct smb_filename *fname); 1265 NTSTATUS smb_vfs_call_durable_cookie(struct vfs_handle_struct *handle, 1266 struct files_struct *fsp, 1267 TALLOC_CTX *mem_ctx, 1268 DATA_BLOB *cookie); 1269 NTSTATUS smb_vfs_call_durable_disconnect(struct vfs_handle_struct *handle, 1270 struct files_struct *fsp, 1271 const DATA_BLOB old_cookie, 1272 TALLOC_CTX *mem_ctx, 1273 DATA_BLOB *new_cookie); 1274 NTSTATUS smb_vfs_call_durable_reconnect(struct vfs_handle_struct *handle, 1275 struct smb_request *smb1req, 1276 struct smbXsrv_open *op, 1277 const DATA_BLOB old_cookie, 1278 TALLOC_CTX *mem_ctx, 1279 struct files_struct **fsp, 1280 DATA_BLOB *new_cookie); 1281 NTSTATUS smb_vfs_call_readdir_attr(struct vfs_handle_struct *handle, 1282 const struct smb_filename *fname, 1283 TALLOC_CTX *mem_ctx, 1284 struct readdir_attr_data **attr_data); 1285 1286 NTSTATUS smb_register_vfs(int version, const char *name, 1287 const struct vfs_fn_pointers *fns); 1288 void *vfs_add_fsp_extension_notype(vfs_handle_struct *handle, 1289 files_struct *fsp, size_t ext_size, 1290 void (*destroy_fn)(void *p_data)); 1291 void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp); 1292 void vfs_remove_all_fsp_extensions(struct files_struct *fsp); 1293 void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp); 1294 void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp); 819 1295 820 1296 #endif /* _VFS_H */
Note:
See TracChangeset
for help on using the changeset viewer.