"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/xlators/meta/src/version-file.c" (16 Sep 2020, 993 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "version-file.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2    Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com>
    3    This file is part of GlusterFS.
    4 
    5    This file is licensed to you under your choice of the GNU Lesser
    6    General Public License, version 3 or any later version (LGPLv3 or
    7    later), or the GNU General Public License, version 2 (GPLv2), in all
    8    cases as published by the Free Software Foundation.
    9 */
   10 
   11 #include <glusterfs/xlator.h>
   12 #include <glusterfs/defaults.h>
   13 
   14 #include "meta-mem-types.h"
   15 #include "meta.h"
   16 #include <glusterfs/strfd.h>
   17 #include <glusterfs/lkowner.h>
   18 
   19 static int
   20 version_file_fill(xlator_t *this, inode_t *file, strfd_t *strfd)
   21 {
   22     strprintf(strfd, "{ \n  \"Package Version\": \"%s\"\n}", PACKAGE_VERSION);
   23     return strfd->size;
   24 }
   25 
   26 static struct meta_ops version_file_ops = {
   27     .file_fill = version_file_fill,
   28 };
   29 
   30 int
   31 meta_version_file_hook(call_frame_t *frame, xlator_t *this, loc_t *loc,
   32                        dict_t *xdata)
   33 {
   34     meta_ops_set(loc->inode, this, &version_file_ops);
   35 
   36     return 0;
   37 }