LCOV - code coverage report
Current view: top level - fs/nfs - nfs4getroot.c (source / functions) Hit Total Coverage
Test: gcov_data_raspi2_real_modules_combined.info Lines: 0 12 0.0 %
Date: 2020-09-30 20:25:40 Functions: 0 1 0.0 %
Branches: 0 8 0.0 %

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: GPL-2.0
       2                 :            : /*
       3                 :            : * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
       4                 :            : * Written by David Howells (dhowells@redhat.com)
       5                 :            : */
       6                 :            : 
       7                 :            : #include <linux/nfs_fs.h>
       8                 :            : #include "nfs4_fs.h"
       9                 :            : #include "internal.h"
      10                 :            : 
      11                 :            : #define NFSDBG_FACILITY         NFSDBG_CLIENT
      12                 :            : 
      13                 :          0 : int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh, bool auth_probe)
      14                 :            : {
      15                 :            :         struct nfs_fsinfo fsinfo;
      16                 :            :         int ret = -ENOMEM;
      17                 :            : 
      18                 :          0 :         fsinfo.fattr = nfs_alloc_fattr();
      19         [ #  # ]:          0 :         if (fsinfo.fattr == NULL)
      20                 :            :                 goto out;
      21                 :            : 
      22                 :            :         /* Start by getting the root filehandle from the server */
      23                 :          0 :         ret = nfs4_proc_get_rootfh(server, mntfh, &fsinfo, auth_probe);
      24         [ #  # ]:          0 :         if (ret < 0) {
      25                 :            :                 dprintk("nfs4_get_rootfh: getroot error = %d\n", -ret);
      26                 :            :                 goto out;
      27                 :            :         }
      28                 :            : 
      29         [ #  # ]:          0 :         if (!(fsinfo.fattr->valid & NFS_ATTR_FATTR_TYPE)
      30         [ #  # ]:          0 :                         || !S_ISDIR(fsinfo.fattr->mode)) {
      31                 :          0 :                 printk(KERN_ERR "nfs4_get_rootfh:"
      32                 :            :                        " getroot encountered non-directory\n");
      33                 :            :                 ret = -ENOTDIR;
      34                 :          0 :                 goto out;
      35                 :            :         }
      36                 :            : 
      37                 :          0 :         memcpy(&server->fsid, &fsinfo.fattr->fsid, sizeof(server->fsid));
      38                 :            : out:
      39                 :          0 :         nfs_free_fattr(fsinfo.fattr);
      40                 :          0 :         return ret;
      41                 :            : }

Generated by: LCOV version 1.14