s3 onefs: Fix the onefs modules after the big refactoring
authorTim Prouty <tprouty@samba.org>
Sat, 25 Jul 2009 00:09:42 +0000 (17:09 -0700)
committerTim Prouty <tprouty@samba.org>
Sat, 25 Jul 2009 01:46:07 +0000 (18:46 -0700)
source3/modules/onefs.h
source3/modules/onefs_acl.c
source3/modules/vfs_onefs.c
source3/modules/vfs_onefs_shadow_copy.c
source3/smbd/oplock_onefs.c

index e0e463778ce4938adc8316eae88539d17882bab1..dd27d44cca028f0f547dd7e5e01b6adcf02ba49a 100644 (file)
@@ -126,13 +126,13 @@ NTSTATUS onefs_get_nt_acl(vfs_handle_struct *handle, const char* name,
                          uint32 security_info, SEC_DESC **ppdesc);
 
 NTSTATUS onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                          uint32 security_info_sent, SEC_DESC *psd);
+                          uint32 security_info_sent, const SEC_DESC *psd);
 
 /*
  * Utility functions
  */
 struct ifs_security_descriptor;
-NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, SEC_DESC *psd,
+NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, const SEC_DESC *psd,
                              struct ifs_security_descriptor *sd, int snum,
                              uint32_t *security_info_effective);
 
index 2753a9e885a919ca31da2fa29fd60b94b18753c0..df4efd58dfa91e4c6b1aa3c980364235e8134d5b 100644 (file)
@@ -819,7 +819,7 @@ onefs_get_nt_acl(vfs_handle_struct *handle, const char* name,
  *
  * @return NTSTATUS_OK if successful
  */
-NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, SEC_DESC *psd,
+NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, const SEC_DESC *psd,
                              struct ifs_security_descriptor *sd, int snum,
                              uint32_t *security_info_effective)
 {
@@ -905,7 +905,7 @@ NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, SEC_DESC *psd,
  */
 NTSTATUS
 onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                 uint32_t sec_info_sent, SEC_DESC *psd)
+                 uint32_t sec_info_sent, const SEC_DESC *psd)
 {
        struct ifs_security_descriptor sd = {};
        int fd = -1;
index 05f6cfdc74c1b06743e9048f4206c705835622ee..31f0b853fb79d88049fdd802878ed5e4f4c397fb 100644 (file)
@@ -108,7 +108,7 @@ static uint64_t onefs_get_alloc_size(struct vfs_handle_struct *handle,
 }
 
 static struct file_id onefs_file_id_create(struct vfs_handle_struct *handle,
-                                            SMB_STRUCT_STAT *sbuf)
+                                          const SMB_STRUCT_STAT *sbuf)
 {
        struct file_id key;
 
@@ -247,19 +247,19 @@ static uint32_t onefs_fs_capabilities(struct vfs_handle_struct *handle)
 }
 
 static struct vfs_fn_pointers onefs_fns = {
-       .connect = onefs_connect,
+       .connect_fn = onefs_connect,
        .fs_capabilities = onefs_fs_capabilities,
        .opendir = onefs_opendir,
        .readdir = onefs_readdir,
        .seekdir = onefs_seekdir,
        .telldir = onefs_telldir,
-       .rewinddir = onefs_rewinddir,
+       .rewind_dir = onefs_rewinddir,
        .mkdir = onefs_mkdir,
        .closedir = onefs_closedir,
        .init_search_op = onefs_init_search_op,
        .open = onefs_open,
        .create_file = onefs_create_file,
-       .close = onefs_close,
+       .close_fn = onefs_close,
        .sendfile = onefs_sendfile,
        .recvfile = onefs_recvfile,
        .rename = onefs_rename,
index b8febdc4264f018d6ba7318abb976978eae989b7..c733392d2774732e215d9789136abd9e660c2c15 100644 (file)
@@ -397,7 +397,7 @@ onefs_shadow_copy_ntimes(vfs_handle_struct *handle,
 /**
  * XXX: macro-ize
  */
-static bool
+static int
 onefs_shadow_copy_symlink(vfs_handle_struct *handle,
     const char *oldpath, const char *newpath)
 {
@@ -671,7 +671,7 @@ static struct vfs_fn_pointers onefs_shadow_copy_fns = {
        .chdir = onefs_shadow_copy_chdir,
        .ntimes = onefs_shadow_copy_ntimes,
        .symlink = onefs_shadow_copy_symlink,
-       .readlink = onefs_shadow_copy_readlink,
+       .vfs_readlink = onefs_shadow_copy_readlink,
        .link = onefs_shadow_copy_link,
        .mknod = onefs_shadow_copy_mknod,
        .realpath = onefs_shadow_copy_realpath,
index a73100abdf05b566ff2df55097b584a6b5db44a7..4a9efe692962c0ef34dcdeee288489a5f6103efc 100644 (file)
@@ -67,22 +67,22 @@ const char *onefs_cb_record_str_dbg(const struct onefs_callback_record *r)
        char *result;
 
        if (r == NULL) {
-               result = talloc_strdup(dbg_ctx(), "NULL callback record");
+               result = talloc_strdup(debug_ctx(), "NULL callback record");
                return result;
        }
 
        switch (r->state) {
        case ONEFS_OPEN_FILE:
-               result = talloc_asprintf(dbg_ctx(), "cb record %llu for file "
-                                        "%s", r->id,
+               result = talloc_asprintf(debug_ctx(), "cb record %llu for "
+                                        "file %s", r->id,
                                         fsp_str_dbg(r->data.fsp));
        case ONEFS_WAITING_FOR_OPLOCK:
-               result = talloc_asprintf(dbg_ctx(), "cb record %llu for "
+               result = talloc_asprintf(debug_ctx(), "cb record %llu for "
                                         "pending mid %d", r->id,
                                         (int)r->data.mid);
                break;
        default:
-               result = talloc_asprintf(dbg_ctx(), "cb record %llu unknown "
+               result = talloc_asprintf(debug_ctx(), "cb record %llu unknown "
                                         "state %d", r->id, r->state);
                break;
        }
@@ -103,7 +103,7 @@ static void debug_cb_records(const char *fn)
        DEBUG(10, ("cb records (%s):\n", fn));
 
        for (rec = callback_recs; rec; rec = rec->next) {
-               DEBUGADD(10, ("%s\n", onefs_cb_record_dbg_str(rec)));
+               DEBUGADD(10, ("%s\n", onefs_cb_record_str_dbg(rec)));
        }
 }
 
@@ -128,7 +128,7 @@ static struct onefs_callback_record *onefs_find_cb(uint64_t id,
        for (rec = callback_recs; rec; rec = rec->next) {
                if (rec->id == id) {
                        DEBUG(10, ("found %s\n",
-                                  onefs_cb_record_dbg_str(rec)));
+                                  onefs_cb_record_str_dbg(rec)));
                        break;
                }
        }
@@ -140,7 +140,7 @@ static struct onefs_callback_record *onefs_find_cb(uint64_t id,
 
        if (rec->state != expected_state) {
                DEBUG(0, ("Expected cb type %d, got %s", expected_state,
-                         onefs_cb_record_dbg_str(rec)));
+                         onefs_cb_record_str_dbg(rec)));
                SMB_ASSERT(0);
                return NULL;
        }
@@ -300,7 +300,7 @@ static void oplock_break_to_none_handler(uint64_t id)
        }
 
        DEBUG(10, ("oplock_break_to_none_handler called for file %s\n",
-                  cb->data.fsp_str_dbg(fsp)));
+                  fsp_str_dbg(cb->data.fsp)));
 
        init_share_mode_entry(&sme, cb, FORCE_OPLOCK_BREAK_TO_NONE);
        share_mode_entry_to_message(msg, &sme);
@@ -337,7 +337,7 @@ static void oplock_break_to_level_two_handler(uint64_t id)
        }
 
        DEBUG(10, ("oplock_break_to_level_two_handler called for file %s\n",
-                  cb->data.fsp_str_dbg(fsp)));
+                  fsp_str_dbg(cb->data.fsp)));
 
        init_share_mode_entry(&sme, cb, LEVEL_II_OPLOCK);
        share_mode_entry_to_message(msg, &sme);
@@ -414,7 +414,7 @@ static void semlock_available_handler(uint64_t id)
                char *msg;
                if (asprintf(&msg, "Semlock available on an open that wasn't "
                             "deferred: %s\n",
-                             onefs_cb_record_dbg_str(cb)) != -1) {
+                             onefs_cb_record_str_dbg(cb)) != -1) {
                        smb_panic(msg);
                }
                smb_panic("Semlock available on an open that wasn't "
@@ -458,7 +458,7 @@ static void semlock_async_failure_handler(uint64_t id)
                char *msg;
                if (asprintf(&msg, "Semlock failure on an open that wasn't "
                             "deferred: %s\n",
-                             onefs_cb_record_dbg_str(cb)) != -1) {
+                             onefs_cb_record_str_dbg(cb)) != -1) {
                        smb_panic(msg);
                }
                smb_panic("Semlock failure on an open that wasn't deferred\n");