nfs-ganesha 1.4

fsal_ds.c

Go to the documentation of this file.
00001 /*
00002  * vim:expandtab:shiftwidth=8:tabstop=8:
00003  *
00004  * Copyright (C) 2010 The Linux Box Corporation
00005  * All Rights Reserved
00006  *
00007  * Contributor: Adam C. Emerson
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 3 of the License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  *
00023  * ---------------------------------------
00024  */
00025 
00034 #ifdef HAVE_CONFIG_H
00035 #include "config.h"
00036 #endif
00037 
00038 #include "fsal.h"
00039 #include "fsal_internal.h"
00040 #include "fsal_convert.h"
00041 #include "nfsv41.h"
00042 #include <fcntl.h>
00043 #include "HashTable.h"
00044 #include <pthread.h>
00045 #include "fsal_types.h"
00046 #include "fsal_pnfs.h"
00047 #include "pnfs_common.h"
00048 #include "fsal_pnfs_files.h"
00049 
00050 #define min(a,b)          \
00051      ({ typeof (a) _a = (a);                    \
00052           typeof (b) _b = (b);                  \
00053           _a < _b ? _a : _b; })
00054 
00074 nfsstat4 LUSTREFSAL_DS_read( fsal_handle_t     * pfsalhandle,
00075                              fsal_op_context_t * pfsalcontext,
00076                              const stateid4    * stateid,
00077                              offset4             offset,
00078                              count4              requested_length,
00079                              caddr_t             buffer,
00080                              count4            * pread_length,
00081                              fsal_boolean_t    * end_of_file)
00082 {
00083 #if 0
00084      /* Our format for the file handle */
00085      lustrefsal_handle_t * phandle = (lustrefsal_handle_t*)pfsalhandle;
00086 
00087      /* Our format for the operational context */
00088      lustrefsal_op_context_t* pcontext = (lustrefsal_op_context_t*)pfsalcontext;
00089 
00090      int uid = FSAL_OP_CONTEXT_TO_UID(context);
00091      int gid = FSAL_OP_CONTEXT_TO_GID(context);
00092 #endif
00093      return NFS4_OK;
00094 }
00095 
00116 nfsstat4 LUSTREFSAL_DS_write( fsal_handle_t     * pfsalhandle,
00117                               fsal_op_context_t * pfsalcontext,
00118                               const stateid4    * stateid,
00119                               offset4             offset,
00120                               count4              write_length,
00121                               caddr_t             buffer,
00122                               stable_how4         stability_wanted,
00123                               count4            * pwritten_length,
00124                               verifier4           writeverf,
00125                               stable_how4       * stability_got )
00126 {
00127 #if 0
00128      /* Our format for the file handle */
00129      lustrefsal_handle_t * phandle = (lustrefsal_handle_t*)pfsalhandle;
00130 
00131      /* Our format for the operational context */
00132      lustrefsal_op_context_t* pcontext = (lustrefsal_op_context_t*)pfsalcontext;
00133 
00134      int uid = FSAL_OP_CONTEXT_TO_UID(context);
00135      int gid = FSAL_OP_CONTEXT_TO_GID(context);
00136 #endif
00137      return NFS4_OK;
00138 } /* LUSTREFSAL_DS_write */
00139 
00155 nfsstat4 LUSTREFSAL_DS_commit( fsal_handle_t     * pfsalhandle,
00156                                fsal_op_context_t * pfsalcontext,
00157                                offset4             offset,
00158                                count4              count,
00159                                verifier4           writeverf)
00160 {
00161 #if 0
00162      /* Our format for the file handle */
00163      lustrefsal_handle_t * phandle = (lustrefsal_handle_t*)pfsalhandle;
00164 
00165      /* Our format for the operational context */
00166      lustrefsal_op_context_t* pcontext = (lustrefsal_op_context_t*)pfsalcontext;
00167 
00168      int uid = FSAL_OP_CONTEXT_TO_UID(context);
00169      int gid = FSAL_OP_CONTEXT_TO_GID(context);
00170 #endif
00171      return NFS4_OK;
00172 } /* LUSTREFSAL_DS_commit */