s3: Announce HSM in the gpfs module
authorVolker Lendecke <vl@samba.org>
Fri, 25 Feb 2011 14:18:46 +0000 (07:18 -0700)
committerVolker Lendecke <vlendec@samba.org>
Wed, 2 Mar 2011 17:39:21 +0000 (18:39 +0100)
docs-xml/manpages-3/vfs_gpfs.8.xml
source3/modules/vfs_gpfs.c

index 3372a951e20f570633fc66d3060f3df395088983..5f89ffac7791026e3e83f2388e760ace096dc768 100644 (file)
                </listitem>
 
                </varlistentry>
+
+               <varlistentry>
+
+               <term>gpfs:hsm = [ yes | no ]</term>
+               <listitem>
+               <para>
+               Enable/Disable announcing if this FS has HSM enabled.
+               </para>
+
+               <itemizedlist>
+               <listitem><para>
+               <command>no(default)</command> - Do not announce HSM.
+               </para></listitem>
+               <listitem><para>
+               <command>no</command> - Announce HSM.
+               </para></listitem>
+               </itemizedlist>
+               </listitem>
+
+               </varlistentry>
+
                <varlistentry>
 
                <term>gpfs:getrealfilename = [ yes | no ]</term>
index d36cdbe2a922fea5573edb5a2fd918cee529b11b..4ee826b71bb4ab07d6b4ec4ec9c0a049010168d4 100644 (file)
@@ -34,6 +34,7 @@
 struct gpfs_config_data {
        bool sharemodes;
        bool leases;
+       bool hsm;
 };
 
 
@@ -1211,6 +1212,9 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
        config->leases = lp_parm_bool(SNUM(handle->conn), "gpfs",
                                        "leases", true);
 
+       config->hsm = lp_parm_bool(SNUM(handle->conn), "gpfs",
+                                  "hsm", false);
+
        SMB_VFS_HANDLE_SET_DATA(handle, config,
                                NULL, struct syncops_config_data,
                                return -1);
@@ -1218,9 +1222,28 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
        return 0;
 }
 
+static uint32_t vfs_gpfs_capabilities(struct vfs_handle_struct *handle,
+                                     enum timestamp_set_resolution *p_ts_res)
+{
+       struct gpfs_config_data *config;
+       uint32_t next;
+
+       next = SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res);
+
+       SMB_VFS_HANDLE_GET_DATA(handle, config,
+                               struct gpfs_config_data,
+                               return next);
+
+       if (config->hsm) {
+               next |= FILE_SUPPORTS_REMOTE_STORAGE;
+       }
+       return next;
+}
+
 
 static struct vfs_fn_pointers vfs_gpfs_fns = {
        .connect_fn = vfs_gpfs_connect,
+       .fs_capabilities = vfs_gpfs_capabilities,
        .kernel_flock = vfs_gpfs_kernel_flock,
         .linux_setlease = vfs_gpfs_setlease,
         .get_real_filename = vfs_gpfs_get_real_filename,