version 1.42, 2011/03/24 17:05:46 |
version 1.42.4.1, 2012/04/17 00:08:57 |
Line 50 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 50 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/proc.h> |
#include <sys/proc.h> |
#include <sys/buf.h> |
#include <sys/buf.h> |
#include <sys/vnode.h> |
#include <sys/vnode.h> |
#include <sys/malloc.h> |
#include <sys/kmem.h> |
#include <sys/kauth.h> |
#include <sys/kauth.h> |
|
|
#include <miscfs/specfs/specdev.h> |
#include <miscfs/specfs/specdev.h> |
|
|
|
#include <sys/quotactl.h> |
#include <ufs/ufs/quota.h> |
#include <ufs/ufs/quota.h> |
#include <ufs/ufs/inode.h> |
#include <ufs/ufs/inode.h> |
#include <ufs/ufs/ufsmount.h> |
#include <ufs/ufs/ufsmount.h> |
Line 62 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 63 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#ifdef UFS_DIRHASH |
#ifdef UFS_DIRHASH |
#include <ufs/ufs/dirhash.h> |
#include <ufs/ufs/dirhash.h> |
#endif |
#endif |
#include <quota/quotaprop.h> |
|
|
|
/* how many times ufs_init() was called */ |
/* how many times ufs_init() was called */ |
static int ufs_initcount = 0; |
static int ufs_initcount = 0; |
Line 100 ufs_root(struct mount *mp, struct vnode |
|
Line 100 ufs_root(struct mount *mp, struct vnode |
|
* Do operations associated with quotas |
* Do operations associated with quotas |
*/ |
*/ |
int |
int |
ufs_quotactl(struct mount *mp, prop_dictionary_t dict) |
ufs_quotactl(struct mount *mp, struct quotactl_args *args) |
{ |
{ |
struct lwp *l = curlwp; |
|
|
|
#if !defined(QUOTA) && !defined(QUOTA2) |
#if !defined(QUOTA) && !defined(QUOTA2) |
(void) mp; |
(void) mp; |
(void) dict; |
(void) args; |
(void) l; |
|
return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
#else |
#else |
int error; |
struct lwp *l = curlwp; |
prop_dictionary_t cmddict; |
int error; |
prop_array_t commands; |
|
prop_object_iterator_t iter; |
|
|
|
/* Mark the mount busy, as we're passing it to kauth(9). */ |
/* Mark the mount busy, as we're passing it to kauth(9). */ |
error = vfs_busy(mp, NULL); |
error = vfs_busy(mp, NULL); |
if (error) |
if (error) { |
return (error); |
return (error); |
|
|
error = quota_get_cmds(dict, &commands); |
|
if (error) |
|
goto out_vfs; |
|
iter = prop_array_iterator(commands); |
|
if (iter == NULL) { |
|
error = ENOMEM; |
|
goto out_vfs; |
|
} |
} |
|
|
|
|
mutex_enter(&mp->mnt_updating); |
mutex_enter(&mp->mnt_updating); |
while ((cmddict = prop_object_iterator_next(iter)) != NULL) { |
|
if (prop_object_type(cmddict) != PROP_TYPE_DICTIONARY) |
error = quota_handle_cmd(mp, l, args); |
continue; |
|
error = quota_handle_cmd(mp, l, cmddict); |
|
if (error) |
|
break; |
|
} |
|
prop_object_iterator_release(iter); |
|
mutex_exit(&mp->mnt_updating); |
mutex_exit(&mp->mnt_updating); |
out_vfs: |
|
vfs_unbusy(mp, false, NULL); |
vfs_unbusy(mp, false, NULL); |
return (error); |
return (error); |
#endif |
#endif |
Line 243 ufs_fhtovp(struct mount *mp, struct ufid |
|
Line 223 ufs_fhtovp(struct mount *mp, struct ufid |
|
return (error); |
return (error); |
} |
} |
ip = VTOI(nvp); |
ip = VTOI(nvp); |
|
KASSERT(ip != NULL); |
if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) { |
if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) { |
vput(nvp); |
vput(nvp); |
*vpp = NULLVP; |
*vpp = NULLVP; |