xfs_super.c (159488) | xfs_super.c (164033) |
---|---|
1/* 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * --- 39 unchanged lines hidden (view full) --- 48#include "xfs_cap.h" 49#include "xfs_mac.h" 50#include "xfs_attr.h" 51#include "xfs_buf_item.h" 52#include "xfs_utils.h" 53#include "xfs_version.h" 54#include "xfs_buf.h" 55 | 1/* 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * --- 39 unchanged lines hidden (view full) --- 48#include "xfs_cap.h" 49#include "xfs_mac.h" 50#include "xfs_attr.h" 51#include "xfs_buf_item.h" 52#include "xfs_utils.h" 53#include "xfs_version.h" 54#include "xfs_buf.h" 55 |
56#include <sys/priv.h> 57 |
|
56#include <geom/geom.h> 57#include <geom/geom_vfs.h> 58 59extern struct vop_vector xfs_fifoops; 60extern struct xfs_vnodeops xfs_vnodeops; 61 62__uint64_t 63xfs_max_file_offset( --- 80 unchanged lines hidden (view full) --- 144 if (!vn_isdisk(devvp, &error)) { 145 vrele(devvp); 146 return (error); 147 } 148 149 vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); 150 151 ronly = ((XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) != 0); | 58#include <geom/geom.h> 59#include <geom/geom_vfs.h> 60 61extern struct vop_vector xfs_fifoops; 62extern struct xfs_vnodeops xfs_vnodeops; 63 64__uint64_t 65xfs_max_file_offset( --- 80 unchanged lines hidden (view full) --- 146 if (!vn_isdisk(devvp, &error)) { 147 vrele(devvp); 148 return (error); 149 } 150 151 vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); 152 153 ronly = ((XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) != 0); |
152 if (suser(td)) { 153 accessmode = VREAD; 154 if (!ronly) 155 accessmode |= VWRITE; 156 if ((error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td))!= 0){ 157 vput(devvp); 158 return (error); 159 } | 154 accessmode = VREAD; 155 if (!ronly) 156 accessmode |= VWRITE; 157 error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td); 158 if (error) 159 error = priv_check(td, PRIV_VFS_MOUNT_PERM); 160 if (error) { 161 vput(devvp); 162 return (error); |
160 } 161 162 DROP_GIANT(); 163 g_topology_lock(); 164 165 /* 166 * XXX: Do not allow more than one consumer to open a device 167 * associated with a particular GEOM provider. --- 109 unchanged lines hidden --- | 163 } 164 165 DROP_GIANT(); 166 g_topology_lock(); 167 168 /* 169 * XXX: Do not allow more than one consumer to open a device 170 * associated with a particular GEOM provider. --- 109 unchanged lines hidden --- |