Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
8e08f6eb
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8e08f6eb
编写于
2月 09, 2009
作者:
F
Felix Blyakher
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.kernel.org/pub/scm/fs/xfs/xfs
上级
9483c89e
fcafb71b
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
346 addition
and
734 deletion
+346
-734
fs/xfs/Makefile
fs/xfs/Makefile
+1
-0
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_iops.c
+9
-21
fs/xfs/linux-2.6/xfs_linux.h
fs/xfs/linux-2.6/xfs_linux.h
+0
-11
fs/xfs/linux-2.6/xfs_quotaops.c
fs/xfs/linux-2.6/xfs_quotaops.c
+157
-0
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_super.c
+3
-61
fs/xfs/linux-2.6/xfs_super.h
fs/xfs/linux-2.6/xfs_super.h
+1
-0
fs/xfs/linux-2.6/xfs_sync.h
fs/xfs/linux-2.6/xfs_sync.h
+1
-0
fs/xfs/quota/xfs_dquot.c
fs/xfs/quota/xfs_dquot.c
+14
-14
fs/xfs/quota/xfs_dquot.h
fs/xfs/quota/xfs_dquot.h
+1
-13
fs/xfs/quota/xfs_qm.c
fs/xfs/quota/xfs_qm.c
+14
-48
fs/xfs/quota/xfs_qm.h
fs/xfs/quota/xfs_qm.h
+10
-10
fs/xfs/quota/xfs_qm_bhv.c
fs/xfs/quota/xfs_qm_bhv.c
+0
-1
fs/xfs/quota/xfs_qm_syscalls.c
fs/xfs/quota/xfs_qm_syscalls.c
+7
-181
fs/xfs/quota/xfs_quota_priv.h
fs/xfs/quota/xfs_quota_priv.h
+15
-25
fs/xfs/xfs_ag.h
fs/xfs/xfs_ag.h
+2
-2
fs/xfs/xfs_da_btree.c
fs/xfs/xfs_da_btree.c
+1
-1
fs/xfs/xfs_da_btree.h
fs/xfs/xfs_da_btree.h
+3
-3
fs/xfs/xfs_ialloc.c
fs/xfs/xfs_ialloc.c
+5
-5
fs/xfs/xfs_ialloc_btree.h
fs/xfs/xfs_ialloc_btree.h
+4
-18
fs/xfs/xfs_log.c
fs/xfs/xfs_log.c
+2
-26
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_log_priv.h
+1
-1
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_log_recover.c
+2
-2
fs/xfs/xfs_mount.h
fs/xfs/xfs_mount.h
+1
-5
fs/xfs/xfs_qmops.c
fs/xfs/xfs_qmops.c
+0
-1
fs/xfs/xfs_quota.h
fs/xfs/xfs_quota.h
+2
-0
fs/xfs/xfs_trans.h
fs/xfs/xfs_trans.h
+6
-6
fs/xfs/xfs_trans_space.h
fs/xfs/xfs_trans_space.h
+1
-1
fs/xfs/xfs_types.h
fs/xfs/xfs_types.h
+0
-8
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.c
+83
-268
fs/xfs/xfs_vnodeops.h
fs/xfs/xfs_vnodeops.h
+0
-2
未找到文件。
fs/xfs/Makefile
浏览文件 @
8e08f6eb
...
@@ -33,6 +33,7 @@ xfs-$(CONFIG_XFS_QUOTA) += $(addprefix quota/, \
...
@@ -33,6 +33,7 @@ xfs-$(CONFIG_XFS_QUOTA) += $(addprefix quota/, \
xfs_qm_syscalls.o
\
xfs_qm_syscalls.o
\
xfs_qm_bhv.o
\
xfs_qm_bhv.o
\
xfs_qm.o
)
xfs_qm.o
)
xfs-$(CONFIG_XFS_QUOTA)
+=
linux-2.6/xfs_quotaops.o
ifeq
($(CONFIG_XFS_QUOTA),y)
ifeq
($(CONFIG_XFS_QUOTA),y)
xfs-$(CONFIG_PROC_FS)
+=
quota/xfs_qm_stats.o
xfs-$(CONFIG_PROC_FS)
+=
quota/xfs_qm_stats.o
...
...
fs/xfs/linux-2.6/xfs_iops.c
浏览文件 @
8e08f6eb
...
@@ -211,8 +211,13 @@ xfs_vn_mknod(
...
@@ -211,8 +211,13 @@ xfs_vn_mknod(
* Irix uses Missed'em'V split, but doesn't want to see
* Irix uses Missed'em'V split, but doesn't want to see
* the upper 5 bits of (14bit) major.
* the upper 5 bits of (14bit) major.
*/
*/
if
(
unlikely
(
!
sysv_valid_dev
(
rdev
)
||
MAJOR
(
rdev
)
&
~
0x1ff
))
if
(
S_ISCHR
(
mode
)
||
S_ISBLK
(
mode
))
{
return
-
EINVAL
;
if
(
unlikely
(
!
sysv_valid_dev
(
rdev
)
||
MAJOR
(
rdev
)
&
~
0x1ff
))
return
-
EINVAL
;
rdev
=
sysv_encode_dev
(
rdev
);
}
else
{
rdev
=
0
;
}
if
(
test_default_acl
&&
test_default_acl
(
dir
))
{
if
(
test_default_acl
&&
test_default_acl
(
dir
))
{
if
(
!
_ACL_ALLOC
(
default_acl
))
{
if
(
!
_ACL_ALLOC
(
default_acl
))
{
...
@@ -224,28 +229,11 @@ xfs_vn_mknod(
...
@@ -224,28 +229,11 @@ xfs_vn_mknod(
}
}
}
}
xfs_dentry_to_name
(
&
name
,
dentry
);
if
(
IS_POSIXACL
(
dir
)
&&
!
default_acl
)
if
(
IS_POSIXACL
(
dir
)
&&
!
default_acl
)
mode
&=
~
current
->
fs
->
umask
;
mode
&=
~
current
->
fs
->
umask
;
switch
(
mode
&
S_IFMT
)
{
xfs_dentry_to_name
(
&
name
,
dentry
);
case
S_IFCHR
:
error
=
xfs_create
(
XFS_I
(
dir
),
&
name
,
mode
,
rdev
,
&
ip
,
NULL
);
case
S_IFBLK
:
case
S_IFIFO
:
case
S_IFSOCK
:
rdev
=
sysv_encode_dev
(
rdev
);
case
S_IFREG
:
error
=
xfs_create
(
XFS_I
(
dir
),
&
name
,
mode
,
rdev
,
&
ip
,
NULL
);
break
;
case
S_IFDIR
:
error
=
xfs_mkdir
(
XFS_I
(
dir
),
&
name
,
mode
,
&
ip
,
NULL
);
break
;
default:
error
=
EINVAL
;
break
;
}
if
(
unlikely
(
error
))
if
(
unlikely
(
error
))
goto
out_free_acl
;
goto
out_free_acl
;
...
...
fs/xfs/linux-2.6/xfs_linux.h
浏览文件 @
8e08f6eb
...
@@ -147,17 +147,6 @@
...
@@ -147,17 +147,6 @@
#define SYNCHRONIZE() barrier()
#define SYNCHRONIZE() barrier()
#define __return_address __builtin_return_address(0)
#define __return_address __builtin_return_address(0)
/*
* IRIX (BSD) quotactl makes use of separate commands for user/group,
* whereas on Linux the syscall encodes this information into the cmd
* field (see the QCMD macro in quota.h). These macros help keep the
* code portable - they are not visible from the syscall interface.
*/
#define Q_XSETGQLIM XQM_CMD(8)
/* set groups disk limits */
#define Q_XGETGQUOTA XQM_CMD(9)
/* get groups disk limits */
#define Q_XSETPQLIM XQM_CMD(10)
/* set projects disk limits */
#define Q_XGETPQUOTA XQM_CMD(11)
/* get projects disk limits */
#define dfltprid 0
#define dfltprid 0
#define MAXPATHLEN 1024
#define MAXPATHLEN 1024
...
...
fs/xfs/linux-2.6/xfs_quotaops.c
0 → 100644
浏览文件 @
8e08f6eb
/*
* Copyright (c) 2008, Christoph Hellwig
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "xfs.h"
#include "xfs_dmapi.h"
#include "xfs_sb.h"
#include "xfs_inum.h"
#include "xfs_ag.h"
#include "xfs_mount.h"
#include "xfs_quota.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_bmap_btree.h"
#include "xfs_inode.h"
#include "quota/xfs_qm.h"
#include <linux/quota.h>
STATIC
int
xfs_quota_type
(
int
type
)
{
switch
(
type
)
{
case
USRQUOTA
:
return
XFS_DQ_USER
;
case
GRPQUOTA
:
return
XFS_DQ_GROUP
;
default:
return
XFS_DQ_PROJ
;
}
}
STATIC
int
xfs_fs_quota_sync
(
struct
super_block
*
sb
,
int
type
)
{
struct
xfs_mount
*
mp
=
XFS_M
(
sb
);
if
(
!
XFS_IS_QUOTA_RUNNING
(
mp
))
return
-
ENOSYS
;
return
-
xfs_sync_inodes
(
mp
,
SYNC_DELWRI
);
}
STATIC
int
xfs_fs_get_xstate
(
struct
super_block
*
sb
,
struct
fs_quota_stat
*
fqs
)
{
struct
xfs_mount
*
mp
=
XFS_M
(
sb
);
if
(
!
XFS_IS_QUOTA_RUNNING
(
mp
))
return
-
ENOSYS
;
return
-
xfs_qm_scall_getqstat
(
mp
,
fqs
);
}
STATIC
int
xfs_fs_set_xstate
(
struct
super_block
*
sb
,
unsigned
int
uflags
,
int
op
)
{
struct
xfs_mount
*
mp
=
XFS_M
(
sb
);
unsigned
int
flags
=
0
;
if
(
sb
->
s_flags
&
MS_RDONLY
)
return
-
EROFS
;
if
(
!
XFS_IS_QUOTA_RUNNING
(
mp
))
return
-
ENOSYS
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
if
(
uflags
&
XFS_QUOTA_UDQ_ACCT
)
flags
|=
XFS_UQUOTA_ACCT
;
if
(
uflags
&
XFS_QUOTA_PDQ_ACCT
)
flags
|=
XFS_PQUOTA_ACCT
;
if
(
uflags
&
XFS_QUOTA_GDQ_ACCT
)
flags
|=
XFS_GQUOTA_ACCT
;
if
(
uflags
&
XFS_QUOTA_UDQ_ENFD
)
flags
|=
XFS_UQUOTA_ENFD
;
if
(
uflags
&
(
XFS_QUOTA_PDQ_ENFD
|
XFS_QUOTA_GDQ_ENFD
))
flags
|=
XFS_OQUOTA_ENFD
;
switch
(
op
)
{
case
Q_XQUOTAON
:
return
-
xfs_qm_scall_quotaon
(
mp
,
flags
);
case
Q_XQUOTAOFF
:
if
(
!
XFS_IS_QUOTA_ON
(
mp
))
return
-
EINVAL
;
return
-
xfs_qm_scall_quotaoff
(
mp
,
flags
);
case
Q_XQUOTARM
:
if
(
XFS_IS_QUOTA_ON
(
mp
))
return
-
EINVAL
;
return
-
xfs_qm_scall_trunc_qfiles
(
mp
,
flags
);
}
return
-
EINVAL
;
}
STATIC
int
xfs_fs_get_xquota
(
struct
super_block
*
sb
,
int
type
,
qid_t
id
,
struct
fs_disk_quota
*
fdq
)
{
struct
xfs_mount
*
mp
=
XFS_M
(
sb
);
if
(
!
XFS_IS_QUOTA_RUNNING
(
mp
))
return
-
ENOSYS
;
if
(
!
XFS_IS_QUOTA_ON
(
mp
))
return
-
ESRCH
;
return
-
xfs_qm_scall_getquota
(
mp
,
id
,
xfs_quota_type
(
type
),
fdq
);
}
STATIC
int
xfs_fs_set_xquota
(
struct
super_block
*
sb
,
int
type
,
qid_t
id
,
struct
fs_disk_quota
*
fdq
)
{
struct
xfs_mount
*
mp
=
XFS_M
(
sb
);
if
(
sb
->
s_flags
&
MS_RDONLY
)
return
-
EROFS
;
if
(
!
XFS_IS_QUOTA_RUNNING
(
mp
))
return
-
ENOSYS
;
if
(
!
XFS_IS_QUOTA_ON
(
mp
))
return
-
ESRCH
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
return
-
xfs_qm_scall_setqlim
(
mp
,
id
,
xfs_quota_type
(
type
),
fdq
);
}
struct
quotactl_ops
xfs_quotactl_operations
=
{
.
quota_sync
=
xfs_fs_quota_sync
,
.
get_xstate
=
xfs_fs_get_xstate
,
.
set_xstate
=
xfs_fs_set_xstate
,
.
get_xquota
=
xfs_fs_get_xquota
,
.
set_xquota
=
xfs_fs_set_xquota
,
};
fs/xfs/linux-2.6/xfs_super.c
浏览文件 @
8e08f6eb
...
@@ -68,7 +68,6 @@
...
@@ -68,7 +68,6 @@
#include <linux/freezer.h>
#include <linux/freezer.h>
#include <linux/parser.h>
#include <linux/parser.h>
static
struct
quotactl_ops
xfs_quotactl_operations
;
static
struct
super_operations
xfs_super_operations
;
static
struct
super_operations
xfs_super_operations
;
static
kmem_zone_t
*
xfs_ioend_zone
;
static
kmem_zone_t
*
xfs_ioend_zone
;
mempool_t
*
xfs_ioend_pool
;
mempool_t
*
xfs_ioend_pool
;
...
@@ -180,7 +179,7 @@ xfs_parseargs(
...
@@ -180,7 +179,7 @@ xfs_parseargs(
int
dswidth
=
0
;
int
dswidth
=
0
;
int
iosize
=
0
;
int
iosize
=
0
;
int
dmapi_implies_ikeep
=
1
;
int
dmapi_implies_ikeep
=
1
;
uchar_t
iosizelog
=
0
;
__uint8_t
iosizelog
=
0
;
/*
/*
* Copy binary VFS mount flags we are interested in.
* Copy binary VFS mount flags we are interested in.
...
@@ -1333,57 +1332,6 @@ xfs_fs_show_options(
...
@@ -1333,57 +1332,6 @@ xfs_fs_show_options(
return
-
xfs_showargs
(
XFS_M
(
mnt
->
mnt_sb
),
m
);
return
-
xfs_showargs
(
XFS_M
(
mnt
->
mnt_sb
),
m
);
}
}
STATIC
int
xfs_fs_quotasync
(
struct
super_block
*
sb
,
int
type
)
{
return
-
XFS_QM_QUOTACTL
(
XFS_M
(
sb
),
Q_XQUOTASYNC
,
0
,
NULL
);
}
STATIC
int
xfs_fs_getxstate
(
struct
super_block
*
sb
,
struct
fs_quota_stat
*
fqs
)
{
return
-
XFS_QM_QUOTACTL
(
XFS_M
(
sb
),
Q_XGETQSTAT
,
0
,
(
caddr_t
)
fqs
);
}
STATIC
int
xfs_fs_setxstate
(
struct
super_block
*
sb
,
unsigned
int
flags
,
int
op
)
{
return
-
XFS_QM_QUOTACTL
(
XFS_M
(
sb
),
op
,
0
,
(
caddr_t
)
&
flags
);
}
STATIC
int
xfs_fs_getxquota
(
struct
super_block
*
sb
,
int
type
,
qid_t
id
,
struct
fs_disk_quota
*
fdq
)
{
return
-
XFS_QM_QUOTACTL
(
XFS_M
(
sb
),
(
type
==
USRQUOTA
)
?
Q_XGETQUOTA
:
((
type
==
GRPQUOTA
)
?
Q_XGETGQUOTA
:
Q_XGETPQUOTA
),
id
,
(
caddr_t
)
fdq
);
}
STATIC
int
xfs_fs_setxquota
(
struct
super_block
*
sb
,
int
type
,
qid_t
id
,
struct
fs_disk_quota
*
fdq
)
{
return
-
XFS_QM_QUOTACTL
(
XFS_M
(
sb
),
(
type
==
USRQUOTA
)
?
Q_XSETQLIM
:
((
type
==
GRPQUOTA
)
?
Q_XSETGQLIM
:
Q_XSETPQLIM
),
id
,
(
caddr_t
)
fdq
);
}
/*
/*
* This function fills in xfs_mount_t fields based on mount args.
* This function fills in xfs_mount_t fields based on mount args.
* Note: the superblock _has_ now been read in.
* Note: the superblock _has_ now been read in.
...
@@ -1466,7 +1414,9 @@ xfs_fs_fill_super(
...
@@ -1466,7 +1414,9 @@ xfs_fs_fill_super(
sb_min_blocksize
(
sb
,
BBSIZE
);
sb_min_blocksize
(
sb
,
BBSIZE
);
sb
->
s_xattr
=
xfs_xattr_handlers
;
sb
->
s_xattr
=
xfs_xattr_handlers
;
sb
->
s_export_op
=
&
xfs_export_operations
;
sb
->
s_export_op
=
&
xfs_export_operations
;
#ifdef CONFIG_XFS_QUOTA
sb
->
s_qcop
=
&
xfs_quotactl_operations
;
sb
->
s_qcop
=
&
xfs_quotactl_operations
;
#endif
sb
->
s_op
=
&
xfs_super_operations
;
sb
->
s_op
=
&
xfs_super_operations
;
error
=
xfs_dmops_get
(
mp
);
error
=
xfs_dmops_get
(
mp
);
...
@@ -1609,14 +1559,6 @@ static struct super_operations xfs_super_operations = {
...
@@ -1609,14 +1559,6 @@ static struct super_operations xfs_super_operations = {
.
show_options
=
xfs_fs_show_options
,
.
show_options
=
xfs_fs_show_options
,
};
};
static
struct
quotactl_ops
xfs_quotactl_operations
=
{
.
quota_sync
=
xfs_fs_quotasync
,
.
get_xstate
=
xfs_fs_getxstate
,
.
set_xstate
=
xfs_fs_setxstate
,
.
get_xquota
=
xfs_fs_getxquota
,
.
set_xquota
=
xfs_fs_setxquota
,
};
static
struct
file_system_type
xfs_fs_type
=
{
static
struct
file_system_type
xfs_fs_type
=
{
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
name
=
"xfs"
,
.
name
=
"xfs"
,
...
...
fs/xfs/linux-2.6/xfs_super.h
浏览文件 @
8e08f6eb
...
@@ -93,6 +93,7 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
...
@@ -93,6 +93,7 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
extern
const
struct
export_operations
xfs_export_operations
;
extern
const
struct
export_operations
xfs_export_operations
;
extern
struct
xattr_handler
*
xfs_xattr_handlers
[];
extern
struct
xattr_handler
*
xfs_xattr_handlers
[];
extern
struct
quotactl_ops
xfs_quotactl_operations
;
#define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info))
#define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info))
...
...
fs/xfs/linux-2.6/xfs_sync.h
浏览文件 @
8e08f6eb
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#define XFS_SYNC_H 1
#define XFS_SYNC_H 1
struct
xfs_mount
;
struct
xfs_mount
;
struct
xfs_perag
;
typedef
struct
bhv_vfs_sync_work
{
typedef
struct
bhv_vfs_sync_work
{
struct
list_head
w_list
;
struct
list_head
w_list
;
...
...
fs/xfs/quota/xfs_dquot.c
浏览文件 @
8e08f6eb
...
@@ -804,7 +804,7 @@ xfs_qm_dqlookup(
...
@@ -804,7 +804,7 @@ xfs_qm_dqlookup(
uint
flist_locked
;
uint
flist_locked
;
xfs_dquot_t
*
d
;
xfs_dquot_t
*
d
;
ASSERT
(
XFS_DQ_IS_HASH_LOCKED
(
qh
));
ASSERT
(
mutex_is_locked
(
&
qh
->
qh_lock
));
flist_locked
=
B_FALSE
;
flist_locked
=
B_FALSE
;
...
@@ -877,7 +877,7 @@ xfs_qm_dqlookup(
...
@@ -877,7 +877,7 @@ xfs_qm_dqlookup(
/*
/*
* move the dquot to the front of the hashchain
* move the dquot to the front of the hashchain
*/
*/
ASSERT
(
XFS_DQ_IS_HASH_LOCKED
(
qh
));
ASSERT
(
mutex_is_locked
(
&
qh
->
qh_lock
));
if
(
dqp
->
HL_PREVP
!=
&
qh
->
qh_next
)
{
if
(
dqp
->
HL_PREVP
!=
&
qh
->
qh_next
)
{
xfs_dqtrace_entry
(
dqp
,
xfs_dqtrace_entry
(
dqp
,
"DQLOOKUP: HASH MOVETOFRONT"
);
"DQLOOKUP: HASH MOVETOFRONT"
);
...
@@ -892,13 +892,13 @@ xfs_qm_dqlookup(
...
@@ -892,13 +892,13 @@ xfs_qm_dqlookup(
}
}
xfs_dqtrace_entry
(
dqp
,
"LOOKUP END"
);
xfs_dqtrace_entry
(
dqp
,
"LOOKUP END"
);
*
O_dqpp
=
dqp
;
*
O_dqpp
=
dqp
;
ASSERT
(
XFS_DQ_IS_HASH_LOCKED
(
qh
));
ASSERT
(
mutex_is_locked
(
&
qh
->
qh_lock
));
return
(
0
);
return
(
0
);
}
}
}
}
*
O_dqpp
=
NULL
;
*
O_dqpp
=
NULL
;
ASSERT
(
XFS_DQ_IS_HASH_LOCKED
(
qh
));
ASSERT
(
mutex_is_locked
(
&
qh
->
qh_lock
));
return
(
1
);
return
(
1
);
}
}
...
@@ -956,7 +956,7 @@ xfs_qm_dqget(
...
@@ -956,7 +956,7 @@ xfs_qm_dqget(
ASSERT
(
ip
->
i_gdquot
==
NULL
);
ASSERT
(
ip
->
i_gdquot
==
NULL
);
}
}
#endif
#endif
XFS_DQ_HASH_LOCK
(
h
);
mutex_lock
(
&
h
->
qh_lock
);
/*
/*
* Look in the cache (hashtable).
* Look in the cache (hashtable).
...
@@ -971,7 +971,7 @@ xfs_qm_dqget(
...
@@ -971,7 +971,7 @@ xfs_qm_dqget(
*/
*/
ASSERT
(
*
O_dqpp
);
ASSERT
(
*
O_dqpp
);
ASSERT
(
XFS_DQ_IS_LOCKED
(
*
O_dqpp
));
ASSERT
(
XFS_DQ_IS_LOCKED
(
*
O_dqpp
));
XFS_DQ_HASH_UNLOCK
(
h
);
mutex_unlock
(
&
h
->
qh_lock
);
xfs_dqtrace_entry
(
*
O_dqpp
,
"DQGET DONE (FROM CACHE)"
);
xfs_dqtrace_entry
(
*
O_dqpp
,
"DQGET DONE (FROM CACHE)"
);
return
(
0
);
/* success */
return
(
0
);
/* success */
}
}
...
@@ -991,7 +991,7 @@ xfs_qm_dqget(
...
@@ -991,7 +991,7 @@ xfs_qm_dqget(
* we don't keep the lock across a disk read
* we don't keep the lock across a disk read
*/
*/
version
=
h
->
qh_version
;
version
=
h
->
qh_version
;
XFS_DQ_HASH_UNLOCK
(
h
);
mutex_unlock
(
&
h
->
qh_lock
);
/*
/*
* Allocate the dquot on the kernel heap, and read the ondisk
* Allocate the dquot on the kernel heap, and read the ondisk
...
@@ -1056,7 +1056,7 @@ xfs_qm_dqget(
...
@@ -1056,7 +1056,7 @@ xfs_qm_dqget(
/*
/*
* Hashlock comes after ilock in lock order
* Hashlock comes after ilock in lock order
*/
*/
XFS_DQ_HASH_LOCK
(
h
);
mutex_lock
(
&
h
->
qh_lock
);
if
(
version
!=
h
->
qh_version
)
{
if
(
version
!=
h
->
qh_version
)
{
xfs_dquot_t
*
tmpdqp
;
xfs_dquot_t
*
tmpdqp
;
/*
/*
...
@@ -1072,7 +1072,7 @@ xfs_qm_dqget(
...
@@ -1072,7 +1072,7 @@ xfs_qm_dqget(
* and start over.
* and start over.
*/
*/
xfs_qm_dqput
(
tmpdqp
);
xfs_qm_dqput
(
tmpdqp
);
XFS_DQ_HASH_UNLOCK
(
h
);
mutex_unlock
(
&
h
->
qh_lock
);
xfs_qm_dqdestroy
(
dqp
);
xfs_qm_dqdestroy
(
dqp
);
XQM_STATS_INC
(
xqmstats
.
xs_qm_dquot_dups
);
XQM_STATS_INC
(
xqmstats
.
xs_qm_dquot_dups
);
goto
again
;
goto
again
;
...
@@ -1083,7 +1083,7 @@ xfs_qm_dqget(
...
@@ -1083,7 +1083,7 @@ xfs_qm_dqget(
* Put the dquot at the beginning of the hash-chain and mp's list
* Put the dquot at the beginning of the hash-chain and mp's list
* LOCK ORDER: hashlock, freelistlock, mplistlock, udqlock, gdqlock ..
* LOCK ORDER: hashlock, freelistlock, mplistlock, udqlock, gdqlock ..
*/
*/
ASSERT
(
XFS_DQ_IS_HASH_LOCKED
(
h
));
ASSERT
(
mutex_is_locked
(
&
h
->
qh_lock
));
dqp
->
q_hash
=
h
;
dqp
->
q_hash
=
h
;
XQM_HASHLIST_INSERT
(
h
,
dqp
);
XQM_HASHLIST_INSERT
(
h
,
dqp
);
...
@@ -1102,7 +1102,7 @@ xfs_qm_dqget(
...
@@ -1102,7 +1102,7 @@ xfs_qm_dqget(
XQM_MPLIST_INSERT
(
&
(
XFS_QI_MPL_LIST
(
mp
)),
dqp
);
XQM_MPLIST_INSERT
(
&
(
XFS_QI_MPL_LIST
(
mp
)),
dqp
);
xfs_qm_mplist_unlock
(
mp
);
xfs_qm_mplist_unlock
(
mp
);
XFS_DQ_HASH_UNLOCK
(
h
);
mutex_unlock
(
&
h
->
qh_lock
);
dqret:
dqret:
ASSERT
((
ip
==
NULL
)
||
xfs_isilocked
(
ip
,
XFS_ILOCK_EXCL
));
ASSERT
((
ip
==
NULL
)
||
xfs_isilocked
(
ip
,
XFS_ILOCK_EXCL
));
xfs_dqtrace_entry
(
dqp
,
"DQGET DONE"
);
xfs_dqtrace_entry
(
dqp
,
"DQGET DONE"
);
...
@@ -1440,7 +1440,7 @@ xfs_qm_dqpurge(
...
@@ -1440,7 +1440,7 @@ xfs_qm_dqpurge(
xfs_mount_t
*
mp
=
dqp
->
q_mount
;
xfs_mount_t
*
mp
=
dqp
->
q_mount
;
ASSERT
(
XFS_QM_IS_MPLIST_LOCKED
(
mp
));
ASSERT
(
XFS_QM_IS_MPLIST_LOCKED
(
mp
));
ASSERT
(
XFS_DQ_IS_HASH_LOCKED
(
dqp
->
q_hash
));
ASSERT
(
mutex_is_locked
(
&
dqp
->
q_hash
->
qh_lock
));
xfs_dqlock
(
dqp
);
xfs_dqlock
(
dqp
);
/*
/*
...
@@ -1453,7 +1453,7 @@ xfs_qm_dqpurge(
...
@@ -1453,7 +1453,7 @@ xfs_qm_dqpurge(
*/
*/
if
(
dqp
->
q_nrefs
!=
0
)
{
if
(
dqp
->
q_nrefs
!=
0
)
{
xfs_dqunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
XFS_DQ_HASH_UNLOCK
(
dqp
->
q_hash
);
mutex_unlock
(
&
dqp
->
q_hash
->
qh_lock
);
return
(
1
);
return
(
1
);
}
}
...
@@ -1517,7 +1517,7 @@ xfs_qm_dqpurge(
...
@@ -1517,7 +1517,7 @@ xfs_qm_dqpurge(
memset
(
&
dqp
->
q_core
,
0
,
sizeof
(
dqp
->
q_core
));
memset
(
&
dqp
->
q_core
,
0
,
sizeof
(
dqp
->
q_core
));
xfs_dqfunlock
(
dqp
);
xfs_dqfunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
XFS_DQ_HASH_UNLOCK
(
thishash
);
mutex_unlock
(
&
thishash
->
qh_lock
);
return
(
0
);
return
(
0
);
}
}
...
...
fs/xfs/quota/xfs_dquot.h
浏览文件 @
8e08f6eb
...
@@ -109,19 +109,6 @@ enum {
...
@@ -109,19 +109,6 @@ enum {
#define XFS_DQHOLD(dqp) ((dqp)->q_nrefs++)
#define XFS_DQHOLD(dqp) ((dqp)->q_nrefs++)
#ifdef DEBUG
static
inline
int
XFS_DQ_IS_LOCKED
(
xfs_dquot_t
*
dqp
)
{
if
(
mutex_trylock
(
&
dqp
->
q_qlock
))
{
mutex_unlock
(
&
dqp
->
q_qlock
);
return
0
;
}
return
1
;
}
#endif
/*
/*
* Manage the q_flush completion queue embedded in the dquot. This completion
* Manage the q_flush completion queue embedded in the dquot. This completion
* queue synchronizes processes attempting to flush the in-core dquot back to
* queue synchronizes processes attempting to flush the in-core dquot back to
...
@@ -142,6 +129,7 @@ static inline void xfs_dqfunlock(xfs_dquot_t *dqp)
...
@@ -142,6 +129,7 @@ static inline void xfs_dqfunlock(xfs_dquot_t *dqp)
complete
(
&
dqp
->
q_flush
);
complete
(
&
dqp
->
q_flush
);
}
}
#define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock)))
#define XFS_DQ_IS_ON_FREELIST(dqp) ((dqp)->dq_flnext != (dqp))
#define XFS_DQ_IS_ON_FREELIST(dqp) ((dqp)->dq_flnext != (dqp))
#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY)
#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY)
#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER)
#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER)
...
...
fs/xfs/quota/xfs_qm.c
浏览文件 @
8e08f6eb
...
@@ -69,8 +69,6 @@ STATIC void xfs_qm_list_destroy(xfs_dqlist_t *);
...
@@ -69,8 +69,6 @@ STATIC void xfs_qm_list_destroy(xfs_dqlist_t *);
STATIC
void
xfs_qm_freelist_init
(
xfs_frlist_t
*
);
STATIC
void
xfs_qm_freelist_init
(
xfs_frlist_t
*
);
STATIC
void
xfs_qm_freelist_destroy
(
xfs_frlist_t
*
);
STATIC
void
xfs_qm_freelist_destroy
(
xfs_frlist_t
*
);
STATIC
int
xfs_qm_mplist_nowait
(
xfs_mount_t
*
);
STATIC
int
xfs_qm_dqhashlock_nowait
(
xfs_dquot_t
*
);
STATIC
int
xfs_qm_init_quotainos
(
xfs_mount_t
*
);
STATIC
int
xfs_qm_init_quotainos
(
xfs_mount_t
*
);
STATIC
int
xfs_qm_init_quotainfo
(
xfs_mount_t
*
);
STATIC
int
xfs_qm_init_quotainfo
(
xfs_mount_t
*
);
...
@@ -219,7 +217,7 @@ xfs_qm_hold_quotafs_ref(
...
@@ -219,7 +217,7 @@ xfs_qm_hold_quotafs_ref(
* the structure could disappear between the entry to this routine and
* the structure could disappear between the entry to this routine and
* a HOLD operation if not locked.
* a HOLD operation if not locked.
*/
*/
XFS_QM_LOCK
(
xfs_Gqm
);
mutex_lock
(
&
xfs_Gqm_lock
);
if
(
xfs_Gqm
==
NULL
)
if
(
xfs_Gqm
==
NULL
)
xfs_Gqm
=
xfs_Gqm_init
();
xfs_Gqm
=
xfs_Gqm_init
();
...
@@ -228,8 +226,8 @@ xfs_qm_hold_quotafs_ref(
...
@@ -228,8 +226,8 @@ xfs_qm_hold_quotafs_ref(
* debugging and statistical purposes, but ...
* debugging and statistical purposes, but ...
* Just take a reference and get out.
* Just take a reference and get out.
*/
*/
XFS_QM_HOLD
(
xfs_Gqm
)
;
xfs_Gqm
->
qm_nrefs
++
;
XFS_QM_UNLOCK
(
xfs_Gqm
);
mutex_unlock
(
&
xfs_Gqm_lock
);
return
0
;
return
0
;
}
}
...
@@ -277,13 +275,12 @@ xfs_qm_rele_quotafs_ref(
...
@@ -277,13 +275,12 @@ xfs_qm_rele_quotafs_ref(
* Destroy the entire XQM. If somebody mounts with quotaon, this'll
* Destroy the entire XQM. If somebody mounts with quotaon, this'll
* be restarted.
* be restarted.
*/
*/
XFS_QM_LOCK
(
xfs_Gqm
);
mutex_lock
(
&
xfs_Gqm_lock
);
XFS_QM_RELE
(
xfs_Gqm
);
if
(
--
xfs_Gqm
->
qm_nrefs
==
0
)
{
if
(
xfs_Gqm
->
qm_nrefs
==
0
)
{
xfs_qm_destroy
(
xfs_Gqm
);
xfs_qm_destroy
(
xfs_Gqm
);
xfs_Gqm
=
NULL
;
xfs_Gqm
=
NULL
;
}
}
XFS_QM_UNLOCK
(
xfs_Gqm
);
mutex_unlock
(
&
xfs_Gqm_lock
);
}
}
/*
/*
...
@@ -577,10 +574,10 @@ xfs_qm_dqpurge_int(
...
@@ -577,10 +574,10 @@ xfs_qm_dqpurge_int(
continue
;
continue
;
}
}
if
(
!
xfs_qm_dqhashlock_nowait
(
dqp
))
{
if
(
!
mutex_trylock
(
&
dqp
->
q_hash
->
qh_lock
))
{
nrecl
=
XFS_QI_MPLRECLAIMS
(
mp
);
nrecl
=
XFS_QI_MPLRECLAIMS
(
mp
);
xfs_qm_mplist_unlock
(
mp
);
xfs_qm_mplist_unlock
(
mp
);
XFS_DQ_HASH_LOCK
(
dqp
->
q_hash
);
mutex_lock
(
&
dqp
->
q_hash
->
qh_lock
);
xfs_qm_mplist_lock
(
mp
);
xfs_qm_mplist_lock
(
mp
);
/*
/*
...
@@ -590,7 +587,7 @@ xfs_qm_dqpurge_int(
...
@@ -590,7 +587,7 @@ xfs_qm_dqpurge_int(
* this point, but somebody might be taking things off.
* this point, but somebody might be taking things off.
*/
*/
if
(
nrecl
!=
XFS_QI_MPLRECLAIMS
(
mp
))
{
if
(
nrecl
!=
XFS_QI_MPLRECLAIMS
(
mp
))
{
XFS_DQ_HASH_UNLOCK
(
dqp
->
q_hash
);
mutex_unlock
(
&
dqp
->
q_hash
->
qh_lock
);
goto
again
;
goto
again
;
}
}
}
}
...
@@ -2028,7 +2025,7 @@ xfs_qm_shake_freelist(
...
@@ -2028,7 +2025,7 @@ xfs_qm_shake_freelist(
* a dqlookup process that holds the hashlock that is
* a dqlookup process that holds the hashlock that is
* waiting for the freelist lock.
* waiting for the freelist lock.
*/
*/
if
(
!
xfs_qm_dqhashlock_nowait
(
dqp
))
{
if
(
!
mutex_trylock
(
&
dqp
->
q_hash
->
qh_lock
))
{
xfs_dqfunlock
(
dqp
);
xfs_dqfunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
dqp
=
dqp
->
dq_flnext
;
dqp
=
dqp
->
dq_flnext
;
...
@@ -2045,7 +2042,7 @@ xfs_qm_shake_freelist(
...
@@ -2045,7 +2042,7 @@ xfs_qm_shake_freelist(
/* XXX put a sentinel so that we can come back here */
/* XXX put a sentinel so that we can come back here */
xfs_dqfunlock
(
dqp
);
xfs_dqfunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
xfs_dqunlock
(
dqp
);
XFS_DQ_HASH_UNLOCK
(
hash
);
mutex_unlock
(
&
hash
->
qh_lock
);
xfs_qm_freelist_unlock
(
xfs_Gqm
);
xfs_qm_freelist_unlock
(
xfs_Gqm
);
if
(
++
restarts
>=
XFS_QM_RECLAIM_MAX_RESTARTS
)
if
(
++
restarts
>=
XFS_QM_RECLAIM_MAX_RESTARTS
)
return
nreclaimed
;
return
nreclaimed
;
...
@@ -2062,7 +2059,7 @@ xfs_qm_shake_freelist(
...
@@ -2062,7 +2059,7 @@ xfs_qm_shake_freelist(
XQM_HASHLIST_REMOVE
(
hash
,
dqp
);
XQM_HASHLIST_REMOVE
(
hash
,
dqp
);
xfs_dqfunlock
(
dqp
);
xfs_dqfunlock
(
dqp
);
xfs_qm_mplist_unlock
(
dqp
->
q_mount
);
xfs_qm_mplist_unlock
(
dqp
->
q_mount
);
XFS_DQ_HASH_UNLOCK
(
hash
);
mutex_unlock
(
&
hash
->
qh_lock
);
off_freelist:
off_freelist:
XQM_FREELIST_REMOVE
(
dqp
);
XQM_FREELIST_REMOVE
(
dqp
);
...
@@ -2204,7 +2201,7 @@ xfs_qm_dqreclaim_one(void)
...
@@ -2204,7 +2201,7 @@ xfs_qm_dqreclaim_one(void)
continue
;
continue
;
}
}
if
(
!
xfs_qm_dqhashlock_nowait
(
dqp
))
if
(
!
mutex_trylock
(
&
dqp
->
q_hash
->
qh_lock
))
goto
mplistunlock
;
goto
mplistunlock
;
ASSERT
(
dqp
->
q_nrefs
==
0
);
ASSERT
(
dqp
->
q_nrefs
==
0
);
...
@@ -2213,7 +2210,7 @@ xfs_qm_dqreclaim_one(void)
...
@@ -2213,7 +2210,7 @@ xfs_qm_dqreclaim_one(void)
XQM_HASHLIST_REMOVE
(
dqp
->
q_hash
,
dqp
);
XQM_HASHLIST_REMOVE
(
dqp
->
q_hash
,
dqp
);
XQM_FREELIST_REMOVE
(
dqp
);
XQM_FREELIST_REMOVE
(
dqp
);
dqpout
=
dqp
;
dqpout
=
dqp
;
XFS_DQ_HASH_UNLOCK
(
dqp
->
q_hash
);
mutex_unlock
(
&
dqp
->
q_hash
->
qh_lock
);
mplistunlock:
mplistunlock:
xfs_qm_mplist_unlock
(
dqp
->
q_mount
);
xfs_qm_mplist_unlock
(
dqp
->
q_mount
);
xfs_dqfunlock
(
dqp
);
xfs_dqfunlock
(
dqp
);
...
@@ -2716,34 +2713,3 @@ xfs_qm_freelist_append(xfs_frlist_t *ql, xfs_dquot_t *dq)
...
@@ -2716,34 +2713,3 @@ xfs_qm_freelist_append(xfs_frlist_t *ql, xfs_dquot_t *dq)
{
{
xfs_qm_freelist_insert
((
xfs_frlist_t
*
)
ql
->
qh_prev
,
dq
);
xfs_qm_freelist_insert
((
xfs_frlist_t
*
)
ql
->
qh_prev
,
dq
);
}
}
STATIC
int
xfs_qm_dqhashlock_nowait
(
xfs_dquot_t
*
dqp
)
{
int
locked
;
locked
=
mutex_trylock
(
&
((
dqp
)
->
q_hash
->
qh_lock
));
return
locked
;
}
int
xfs_qm_freelist_lock_nowait
(
xfs_qm_t
*
xqm
)
{
int
locked
;
locked
=
mutex_trylock
(
&
(
xqm
->
qm_dqfreelist
.
qh_lock
));
return
locked
;
}
STATIC
int
xfs_qm_mplist_nowait
(
xfs_mount_t
*
mp
)
{
int
locked
;
ASSERT
(
mp
->
m_quotainfo
);
locked
=
mutex_trylock
(
&
(
XFS_QI_MPLLOCK
(
mp
)));
return
locked
;
}
fs/xfs/quota/xfs_qm.h
浏览文件 @
8e08f6eb
...
@@ -158,11 +158,6 @@ typedef struct xfs_dquot_acct {
...
@@ -158,11 +158,6 @@ typedef struct xfs_dquot_acct {
#define XFS_QM_IWARNLIMIT 5
#define XFS_QM_IWARNLIMIT 5
#define XFS_QM_RTBWARNLIMIT 5
#define XFS_QM_RTBWARNLIMIT 5
#define XFS_QM_LOCK(xqm) (mutex_lock(&xqm##_lock))
#define XFS_QM_UNLOCK(xqm) (mutex_unlock(&xqm##_lock))
#define XFS_QM_HOLD(xqm) ((xqm)->qm_nrefs++)
#define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--)
extern
void
xfs_qm_destroy_quotainfo
(
xfs_mount_t
*
);
extern
void
xfs_qm_destroy_quotainfo
(
xfs_mount_t
*
);
extern
void
xfs_qm_mount_quotas
(
xfs_mount_t
*
);
extern
void
xfs_qm_mount_quotas
(
xfs_mount_t
*
);
extern
int
xfs_qm_quotacheck
(
xfs_mount_t
*
);
extern
int
xfs_qm_quotacheck
(
xfs_mount_t
*
);
...
@@ -178,6 +173,16 @@ extern void xfs_qm_dqdetach(xfs_inode_t *);
...
@@ -178,6 +173,16 @@ extern void xfs_qm_dqdetach(xfs_inode_t *);
extern
int
xfs_qm_dqpurge_all
(
xfs_mount_t
*
,
uint
);
extern
int
xfs_qm_dqpurge_all
(
xfs_mount_t
*
,
uint
);
extern
void
xfs_qm_dqrele_all_inodes
(
xfs_mount_t
*
,
uint
);
extern
void
xfs_qm_dqrele_all_inodes
(
xfs_mount_t
*
,
uint
);
/* quota ops */
extern
int
xfs_qm_scall_trunc_qfiles
(
xfs_mount_t
*
,
uint
);
extern
int
xfs_qm_scall_getquota
(
xfs_mount_t
*
,
xfs_dqid_t
,
uint
,
fs_disk_quota_t
*
);
extern
int
xfs_qm_scall_setqlim
(
xfs_mount_t
*
,
xfs_dqid_t
,
uint
,
fs_disk_quota_t
*
);
extern
int
xfs_qm_scall_getqstat
(
xfs_mount_t
*
,
fs_quota_stat_t
*
);
extern
int
xfs_qm_scall_quotaon
(
xfs_mount_t
*
,
uint
);
extern
int
xfs_qm_scall_quotaoff
(
xfs_mount_t
*
,
uint
);
/* vop stuff */
/* vop stuff */
extern
int
xfs_qm_vop_dqalloc
(
xfs_mount_t
*
,
xfs_inode_t
*
,
extern
int
xfs_qm_vop_dqalloc
(
xfs_mount_t
*
,
xfs_inode_t
*
,
uid_t
,
gid_t
,
prid_t
,
uint
,
uid_t
,
gid_t
,
prid_t
,
uint
,
...
@@ -194,11 +199,6 @@ extern int xfs_qm_vop_chown_reserve(xfs_trans_t *, xfs_inode_t *,
...
@@ -194,11 +199,6 @@ extern int xfs_qm_vop_chown_reserve(xfs_trans_t *, xfs_inode_t *,
/* list stuff */
/* list stuff */
extern
void
xfs_qm_freelist_append
(
xfs_frlist_t
*
,
xfs_dquot_t
*
);
extern
void
xfs_qm_freelist_append
(
xfs_frlist_t
*
,
xfs_dquot_t
*
);
extern
void
xfs_qm_freelist_unlink
(
xfs_dquot_t
*
);
extern
void
xfs_qm_freelist_unlink
(
xfs_dquot_t
*
);
extern
int
xfs_qm_freelist_lock_nowait
(
xfs_qm_t
*
);
/* system call interface */
extern
int
xfs_qm_quotactl
(
struct
xfs_mount
*
,
int
,
int
,
xfs_caddr_t
);
#ifdef DEBUG
#ifdef DEBUG
extern
int
xfs_qm_internalqcheck
(
xfs_mount_t
*
);
extern
int
xfs_qm_internalqcheck
(
xfs_mount_t
*
);
...
...
fs/xfs/quota/xfs_qm_bhv.c
浏览文件 @
8e08f6eb
...
@@ -235,7 +235,6 @@ struct xfs_qmops xfs_qmcore_xfs = {
...
@@ -235,7 +235,6 @@ struct xfs_qmops xfs_qmcore_xfs = {
.
xfs_dqvopchownresv
=
xfs_qm_vop_chown_reserve
,
.
xfs_dqvopchownresv
=
xfs_qm_vop_chown_reserve
,
.
xfs_dqstatvfs
=
xfs_qm_statvfs
,
.
xfs_dqstatvfs
=
xfs_qm_statvfs
,
.
xfs_dqsync
=
xfs_qm_sync
,
.
xfs_dqsync
=
xfs_qm_sync
,
.
xfs_quotactl
=
xfs_qm_quotactl
,
.
xfs_dqtrxops
=
&
xfs_trans_dquot_ops
,
.
xfs_dqtrxops
=
&
xfs_trans_dquot_ops
,
};
};
EXPORT_SYMBOL
(
xfs_qmcore_xfs
);
EXPORT_SYMBOL
(
xfs_qmcore_xfs
);
...
...
fs/xfs/quota/xfs_qm_syscalls.c
浏览文件 @
8e08f6eb
...
@@ -57,134 +57,15 @@
...
@@ -57,134 +57,15 @@
# define qdprintk(s, args...) do { } while (0)
# define qdprintk(s, args...) do { } while (0)
#endif
#endif
STATIC
int
xfs_qm_scall_trunc_qfiles
(
xfs_mount_t
*
,
uint
);
STATIC
int
xfs_qm_scall_getquota
(
xfs_mount_t
*
,
xfs_dqid_t
,
uint
,
fs_disk_quota_t
*
);
STATIC
int
xfs_qm_scall_getqstat
(
xfs_mount_t
*
,
fs_quota_stat_t
*
);
STATIC
int
xfs_qm_scall_setqlim
(
xfs_mount_t
*
,
xfs_dqid_t
,
uint
,
fs_disk_quota_t
*
);
STATIC
int
xfs_qm_scall_quotaon
(
xfs_mount_t
*
,
uint
);
STATIC
int
xfs_qm_scall_quotaoff
(
xfs_mount_t
*
,
uint
,
boolean_t
);
STATIC
int
xfs_qm_log_quotaoff
(
xfs_mount_t
*
,
xfs_qoff_logitem_t
**
,
uint
);
STATIC
int
xfs_qm_log_quotaoff
(
xfs_mount_t
*
,
xfs_qoff_logitem_t
**
,
uint
);
STATIC
int
xfs_qm_log_quotaoff_end
(
xfs_mount_t
*
,
xfs_qoff_logitem_t
*
,
STATIC
int
xfs_qm_log_quotaoff_end
(
xfs_mount_t
*
,
xfs_qoff_logitem_t
*
,
uint
);
uint
);
STATIC
uint
xfs_qm_import_flags
(
uint
);
STATIC
uint
xfs_qm_export_flags
(
uint
);
STATIC
uint
xfs_qm_export_flags
(
uint
);
STATIC
uint
xfs_qm_import_qtype_flags
(
uint
);
STATIC
uint
xfs_qm_export_qtype_flags
(
uint
);
STATIC
uint
xfs_qm_export_qtype_flags
(
uint
);
STATIC
void
xfs_qm_export_dquot
(
xfs_mount_t
*
,
xfs_disk_dquot_t
*
,
STATIC
void
xfs_qm_export_dquot
(
xfs_mount_t
*
,
xfs_disk_dquot_t
*
,
fs_disk_quota_t
*
);
fs_disk_quota_t
*
);
/*
* The main distribution switch of all XFS quotactl system calls.
*/
int
xfs_qm_quotactl
(
xfs_mount_t
*
mp
,
int
cmd
,
int
id
,
xfs_caddr_t
addr
)
{
int
error
;
ASSERT
(
addr
!=
NULL
||
cmd
==
Q_XQUOTASYNC
);
/*
* The following commands are valid even when quotaoff.
*/
switch
(
cmd
)
{
case
Q_XQUOTARM
:
/*
* Truncate quota files. quota must be off.
*/
if
(
XFS_IS_QUOTA_ON
(
mp
))
return
XFS_ERROR
(
EINVAL
);
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
return
(
xfs_qm_scall_trunc_qfiles
(
mp
,
xfs_qm_import_qtype_flags
(
*
(
uint
*
)
addr
)));
case
Q_XGETQSTAT
:
/*
* Get quota status information.
*/
return
(
xfs_qm_scall_getqstat
(
mp
,
(
fs_quota_stat_t
*
)
addr
));
case
Q_XQUOTAON
:
/*
* QUOTAON - enabling quota enforcement.
* Quota accounting must be turned on at mount time.
*/
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
return
(
xfs_qm_scall_quotaon
(
mp
,
xfs_qm_import_flags
(
*
(
uint
*
)
addr
)));
case
Q_XQUOTAOFF
:
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
break
;
case
Q_XQUOTASYNC
:
return
xfs_sync_inodes
(
mp
,
SYNC_DELWRI
);
default:
break
;
}
if
(
!
XFS_IS_QUOTA_ON
(
mp
))
return
XFS_ERROR
(
ESRCH
);
switch
(
cmd
)
{
case
Q_XQUOTAOFF
:
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
error
=
xfs_qm_scall_quotaoff
(
mp
,
xfs_qm_import_flags
(
*
(
uint
*
)
addr
),
B_FALSE
);
break
;
case
Q_XGETQUOTA
:
error
=
xfs_qm_scall_getquota
(
mp
,
(
xfs_dqid_t
)
id
,
XFS_DQ_USER
,
(
fs_disk_quota_t
*
)
addr
);
break
;
case
Q_XGETGQUOTA
:
error
=
xfs_qm_scall_getquota
(
mp
,
(
xfs_dqid_t
)
id
,
XFS_DQ_GROUP
,
(
fs_disk_quota_t
*
)
addr
);
break
;
case
Q_XGETPQUOTA
:
error
=
xfs_qm_scall_getquota
(
mp
,
(
xfs_dqid_t
)
id
,
XFS_DQ_PROJ
,
(
fs_disk_quota_t
*
)
addr
);
break
;
case
Q_XSETQLIM
:
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
error
=
xfs_qm_scall_setqlim
(
mp
,
(
xfs_dqid_t
)
id
,
XFS_DQ_USER
,
(
fs_disk_quota_t
*
)
addr
);
break
;
case
Q_XSETGQLIM
:
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
error
=
xfs_qm_scall_setqlim
(
mp
,
(
xfs_dqid_t
)
id
,
XFS_DQ_GROUP
,
(
fs_disk_quota_t
*
)
addr
);
break
;
case
Q_XSETPQLIM
:
if
(
mp
->
m_flags
&
XFS_MOUNT_RDONLY
)
return
XFS_ERROR
(
EROFS
);
error
=
xfs_qm_scall_setqlim
(
mp
,
(
xfs_dqid_t
)
id
,
XFS_DQ_PROJ
,
(
fs_disk_quota_t
*
)
addr
);
break
;
default:
error
=
XFS_ERROR
(
EINVAL
);
break
;
}
return
(
error
);
}
/*
/*
* Turn off quota accounting and/or enforcement for all udquots and/or
* Turn off quota accounting and/or enforcement for all udquots and/or
* gdquots. Called only at unmount time.
* gdquots. Called only at unmount time.
...
@@ -193,11 +74,10 @@ xfs_qm_quotactl(
...
@@ -193,11 +74,10 @@ xfs_qm_quotactl(
* incore, and modifies the ondisk dquot directly. Therefore, for example,
* incore, and modifies the ondisk dquot directly. Therefore, for example,
* it is an error to call this twice, without purging the cache.
* it is an error to call this twice, without purging the cache.
*/
*/
STATIC
int
int
xfs_qm_scall_quotaoff
(
xfs_qm_scall_quotaoff
(
xfs_mount_t
*
mp
,
xfs_mount_t
*
mp
,
uint
flags
,
uint
flags
)
boolean_t
force
)
{
{
uint
dqtype
;
uint
dqtype
;
int
error
;
int
error
;
...
@@ -205,8 +85,6 @@ xfs_qm_scall_quotaoff(
...
@@ -205,8 +85,6 @@ xfs_qm_scall_quotaoff(
xfs_qoff_logitem_t
*
qoffstart
;
xfs_qoff_logitem_t
*
qoffstart
;
int
nculprits
;
int
nculprits
;
if
(
!
force
&&
!
capable
(
CAP_SYS_ADMIN
))
return
XFS_ERROR
(
EPERM
);
/*
/*
* No file system can have quotas enabled on disk but not in core.
* No file system can have quotas enabled on disk but not in core.
* Note that quota utilities (like quotaoff) _expect_
* Note that quota utilities (like quotaoff) _expect_
...
@@ -375,7 +253,7 @@ xfs_qm_scall_quotaoff(
...
@@ -375,7 +253,7 @@ xfs_qm_scall_quotaoff(
return
(
error
);
return
(
error
);
}
}
STATIC
int
int
xfs_qm_scall_trunc_qfiles
(
xfs_qm_scall_trunc_qfiles
(
xfs_mount_t
*
mp
,
xfs_mount_t
*
mp
,
uint
flags
)
uint
flags
)
...
@@ -383,8 +261,6 @@ xfs_qm_scall_trunc_qfiles(
...
@@ -383,8 +261,6 @@ xfs_qm_scall_trunc_qfiles(
int
error
=
0
,
error2
=
0
;
int
error
=
0
,
error2
=
0
;
xfs_inode_t
*
qip
;
xfs_inode_t
*
qip
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
XFS_ERROR
(
EPERM
);
if
(
!
xfs_sb_version_hasquota
(
&
mp
->
m_sb
)
||
flags
==
0
)
{
if
(
!
xfs_sb_version_hasquota
(
&
mp
->
m_sb
)
||
flags
==
0
)
{
qdprintk
(
"qtrunc flags=%x m_qflags=%x
\n
"
,
flags
,
mp
->
m_qflags
);
qdprintk
(
"qtrunc flags=%x m_qflags=%x
\n
"
,
flags
,
mp
->
m_qflags
);
return
XFS_ERROR
(
EINVAL
);
return
XFS_ERROR
(
EINVAL
);
...
@@ -416,7 +292,7 @@ xfs_qm_scall_trunc_qfiles(
...
@@ -416,7 +292,7 @@ xfs_qm_scall_trunc_qfiles(
* effect immediately.
* effect immediately.
* (Switching on quota accounting must be done at mount time.)
* (Switching on quota accounting must be done at mount time.)
*/
*/
STATIC
int
int
xfs_qm_scall_quotaon
(
xfs_qm_scall_quotaon
(
xfs_mount_t
*
mp
,
xfs_mount_t
*
mp
,
uint
flags
)
uint
flags
)
...
@@ -426,9 +302,6 @@ xfs_qm_scall_quotaon(
...
@@ -426,9 +302,6 @@ xfs_qm_scall_quotaon(
uint
accflags
;
uint
accflags
;
__int64_t
sbflags
;
__int64_t
sbflags
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
XFS_ERROR
(
EPERM
);
flags
&=
(
XFS_ALL_QUOTA_ACCT
|
XFS_ALL_QUOTA_ENFD
);
flags
&=
(
XFS_ALL_QUOTA_ACCT
|
XFS_ALL_QUOTA_ENFD
);
/*
/*
* Switching on quota accounting must be done at mount time.
* Switching on quota accounting must be done at mount time.
...
@@ -517,7 +390,7 @@ xfs_qm_scall_quotaon(
...
@@ -517,7 +390,7 @@ xfs_qm_scall_quotaon(
/*
/*
* Return quota status information, such as uquota-off, enforcements, etc.
* Return quota status information, such as uquota-off, enforcements, etc.
*/
*/
STATIC
int
int
xfs_qm_scall_getqstat
(
xfs_qm_scall_getqstat
(
xfs_mount_t
*
mp
,
xfs_mount_t
*
mp
,
fs_quota_stat_t
*
out
)
fs_quota_stat_t
*
out
)
...
@@ -582,7 +455,7 @@ xfs_qm_scall_getqstat(
...
@@ -582,7 +455,7 @@ xfs_qm_scall_getqstat(
/*
/*
* Adjust quota limits, and start/stop timers accordingly.
* Adjust quota limits, and start/stop timers accordingly.
*/
*/
STATIC
int
int
xfs_qm_scall_setqlim
(
xfs_qm_scall_setqlim
(
xfs_mount_t
*
mp
,
xfs_mount_t
*
mp
,
xfs_dqid_t
id
,
xfs_dqid_t
id
,
...
@@ -595,9 +468,6 @@ xfs_qm_scall_setqlim(
...
@@ -595,9 +468,6 @@ xfs_qm_scall_setqlim(
int
error
;
int
error
;
xfs_qcnt_t
hard
,
soft
;
xfs_qcnt_t
hard
,
soft
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
XFS_ERROR
(
EPERM
);
if
((
newlim
->
d_fieldmask
&
if
((
newlim
->
d_fieldmask
&
(
FS_DQ_LIMIT_MASK
|
FS_DQ_TIMER_MASK
|
FS_DQ_WARNS_MASK
))
==
0
)
(
FS_DQ_LIMIT_MASK
|
FS_DQ_TIMER_MASK
|
FS_DQ_WARNS_MASK
))
==
0
)
return
(
0
);
return
(
0
);
...
@@ -742,7 +612,7 @@ xfs_qm_scall_setqlim(
...
@@ -742,7 +612,7 @@ xfs_qm_scall_setqlim(
return
error
;
return
error
;
}
}
STATIC
int
int
xfs_qm_scall_getquota
(
xfs_qm_scall_getquota
(
xfs_mount_t
*
mp
,
xfs_mount_t
*
mp
,
xfs_dqid_t
id
,
xfs_dqid_t
id
,
...
@@ -934,30 +804,6 @@ xfs_qm_export_dquot(
...
@@ -934,30 +804,6 @@ xfs_qm_export_dquot(
#endif
#endif
}
}
STATIC
uint
xfs_qm_import_qtype_flags
(
uint
uflags
)
{
uint
oflags
=
0
;
/*
* Can't be more than one, or none.
*/
if
(((
uflags
&
(
XFS_GROUP_QUOTA
|
XFS_USER_QUOTA
))
==
(
XFS_GROUP_QUOTA
|
XFS_USER_QUOTA
))
||
((
uflags
&
(
XFS_GROUP_QUOTA
|
XFS_PROJ_QUOTA
))
==
(
XFS_GROUP_QUOTA
|
XFS_PROJ_QUOTA
))
||
((
uflags
&
(
XFS_USER_QUOTA
|
XFS_PROJ_QUOTA
))
==
(
XFS_USER_QUOTA
|
XFS_PROJ_QUOTA
))
||
((
uflags
&
(
XFS_GROUP_QUOTA
|
XFS_USER_QUOTA
|
XFS_PROJ_QUOTA
))
==
0
))
return
(
0
);
oflags
|=
(
uflags
&
XFS_USER_QUOTA
)
?
XFS_DQ_USER
:
0
;
oflags
|=
(
uflags
&
XFS_PROJ_QUOTA
)
?
XFS_DQ_PROJ
:
0
;
oflags
|=
(
uflags
&
XFS_GROUP_QUOTA
)
?
XFS_DQ_GROUP
:
0
;
return
oflags
;
}
STATIC
uint
STATIC
uint
xfs_qm_export_qtype_flags
(
xfs_qm_export_qtype_flags
(
uint
flags
)
uint
flags
)
...
@@ -978,26 +824,6 @@ xfs_qm_export_qtype_flags(
...
@@ -978,26 +824,6 @@ xfs_qm_export_qtype_flags(
XFS_PROJ_QUOTA
:
XFS_GROUP_QUOTA
;
XFS_PROJ_QUOTA
:
XFS_GROUP_QUOTA
;
}
}
STATIC
uint
xfs_qm_import_flags
(
uint
uflags
)
{
uint
flags
=
0
;
if
(
uflags
&
XFS_QUOTA_UDQ_ACCT
)
flags
|=
XFS_UQUOTA_ACCT
;
if
(
uflags
&
XFS_QUOTA_PDQ_ACCT
)
flags
|=
XFS_PQUOTA_ACCT
;
if
(
uflags
&
XFS_QUOTA_GDQ_ACCT
)
flags
|=
XFS_GQUOTA_ACCT
;
if
(
uflags
&
XFS_QUOTA_UDQ_ENFD
)
flags
|=
XFS_UQUOTA_ENFD
;
if
(
uflags
&
(
XFS_QUOTA_PDQ_ENFD
|
XFS_QUOTA_GDQ_ENFD
))
flags
|=
XFS_OQUOTA_ENFD
;
return
(
flags
);
}
STATIC
uint
STATIC
uint
xfs_qm_export_flags
(
xfs_qm_export_flags
(
uint
flags
)
uint
flags
)
...
...
fs/xfs/quota/xfs_quota_priv.h
浏览文件 @
8e08f6eb
...
@@ -42,34 +42,24 @@
...
@@ -42,34 +42,24 @@
#define XFS_QI_QOFFLOCK(mp) ((mp)->m_quotainfo->qi_quotaofflock)
#define XFS_QI_QOFFLOCK(mp) ((mp)->m_quotainfo->qi_quotaofflock)
#define XFS_QI_MPL_LIST(mp) ((mp)->m_quotainfo->qi_dqlist)
#define XFS_QI_MPL_LIST(mp) ((mp)->m_quotainfo->qi_dqlist)
#define XFS_QI_MPLLOCK(mp) ((mp)->m_quotainfo->qi_dqlist.qh_lock)
#define XFS_QI_MPLNEXT(mp) ((mp)->m_quotainfo->qi_dqlist.qh_next)
#define XFS_QI_MPLNEXT(mp) ((mp)->m_quotainfo->qi_dqlist.qh_next)
#define XFS_QI_MPLNDQUOTS(mp) ((mp)->m_quotainfo->qi_dqlist.qh_nelems)
#define XFS_QI_MPLNDQUOTS(mp) ((mp)->m_quotainfo->qi_dqlist.qh_nelems)
#define XQMLCK(h) (mutex_lock(&((h)->qh_lock)))
#define xfs_qm_mplist_lock(mp) \
#define XQMUNLCK(h) (mutex_unlock(&((h)->qh_lock)))
mutex_lock(&(XFS_QI_MPL_LIST(mp).qh_lock))
#ifdef DEBUG
#define xfs_qm_mplist_nowait(mp) \
struct
xfs_dqhash
;
mutex_trylock(&(XFS_QI_MPL_LIST(mp).qh_lock))
static
inline
int
XQMISLCKD
(
struct
xfs_dqhash
*
h
)
#define xfs_qm_mplist_unlock(mp) \
{
mutex_unlock(&(XFS_QI_MPL_LIST(mp).qh_lock))
if
(
mutex_trylock
(
&
h
->
qh_lock
))
{
#define XFS_QM_IS_MPLIST_LOCKED(mp) \
mutex_unlock
(
&
h
->
qh_lock
);
mutex_is_locked(&(XFS_QI_MPL_LIST(mp).qh_lock))
return
0
;
}
#define xfs_qm_freelist_lock(qm) \
return
1
;
mutex_lock(&((qm)->qm_dqfreelist.qh_lock))
}
#define xfs_qm_freelist_lock_nowait(qm) \
#endif
mutex_trylock(&((qm)->qm_dqfreelist.qh_lock))
#define xfs_qm_freelist_unlock(qm) \
#define XFS_DQ_HASH_LOCK(h) XQMLCK(h)
mutex_unlock(&((qm)->qm_dqfreelist.qh_lock))
#define XFS_DQ_HASH_UNLOCK(h) XQMUNLCK(h)
#define XFS_DQ_IS_HASH_LOCKED(h) XQMISLCKD(h)
#define xfs_qm_mplist_lock(mp) XQMLCK(&(XFS_QI_MPL_LIST(mp)))
#define xfs_qm_mplist_unlock(mp) XQMUNLCK(&(XFS_QI_MPL_LIST(mp)))
#define XFS_QM_IS_MPLIST_LOCKED(mp) XQMISLCKD(&(XFS_QI_MPL_LIST(mp)))
#define xfs_qm_freelist_lock(qm) XQMLCK(&((qm)->qm_dqfreelist))
#define xfs_qm_freelist_unlock(qm) XQMUNLCK(&((qm)->qm_dqfreelist))
/*
/*
* Hash into a bucket in the dquot hash table, based on <mp, id>.
* Hash into a bucket in the dquot hash table, based on <mp, id>.
...
...
fs/xfs/xfs_ag.h
浏览文件 @
8e08f6eb
...
@@ -223,8 +223,8 @@ typedef struct xfs_perag
...
@@ -223,8 +223,8 @@ typedef struct xfs_perag
be32_to_cpu((a)->agf_levels[XFS_BTNUM_CNTi]), mp))
be32_to_cpu((a)->agf_levels[XFS_BTNUM_CNTi]), mp))
#define XFS_MIN_FREELIST_PAG(pag,mp) \
#define XFS_MIN_FREELIST_PAG(pag,mp) \
(XFS_MIN_FREELIST_RAW( \
(XFS_MIN_FREELIST_RAW( \
(u
int_
t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
(u
nsigned in
t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
(u
int_
t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp))
(u
nsigned in
t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp))
#define XFS_AGB_TO_FSB(mp,agno,agbno) \
#define XFS_AGB_TO_FSB(mp,agno,agbno) \
(((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))
(((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))
...
...
fs/xfs/xfs_da_btree.c
浏览文件 @
8e08f6eb
...
@@ -1503,7 +1503,7 @@ xfs_da_path_shift(xfs_da_state_t *state, xfs_da_state_path_t *path,
...
@@ -1503,7 +1503,7 @@ xfs_da_path_shift(xfs_da_state_t *state, xfs_da_state_path_t *path,
* This is implemented with some source-level loop unrolling.
* This is implemented with some source-level loop unrolling.
*/
*/
xfs_dahash_t
xfs_dahash_t
xfs_da_hashname
(
const
uchar
_t
*
name
,
int
namelen
)
xfs_da_hashname
(
const
__uint8
_t
*
name
,
int
namelen
)
{
{
xfs_dahash_t
hash
;
xfs_dahash_t
hash
;
...
...
fs/xfs/xfs_da_btree.h
浏览文件 @
8e08f6eb
...
@@ -91,9 +91,9 @@ enum xfs_dacmp {
...
@@ -91,9 +91,9 @@ enum xfs_dacmp {
* Structure to ease passing around component names.
* Structure to ease passing around component names.
*/
*/
typedef
struct
xfs_da_args
{
typedef
struct
xfs_da_args
{
const
uchar
_t
*
name
;
/* string (maybe not NULL terminated) */
const
__uint8
_t
*
name
;
/* string (maybe not NULL terminated) */
int
namelen
;
/* length of string (maybe no NULL) */
int
namelen
;
/* length of string (maybe no NULL) */
uchar_t
*
value
;
/* set of bytes (maybe contain NULLs) */
__uint8_t
*
value
;
/* set of bytes (maybe contain NULLs) */
int
valuelen
;
/* length of value */
int
valuelen
;
/* length of value */
int
flags
;
/* argument flags (eg: ATTR_NOCREATE) */
int
flags
;
/* argument flags (eg: ATTR_NOCREATE) */
xfs_dahash_t
hashval
;
/* hash value of name */
xfs_dahash_t
hashval
;
/* hash value of name */
...
@@ -251,7 +251,7 @@ xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp,
...
@@ -251,7 +251,7 @@ xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp,
int
xfs_da_shrink_inode
(
xfs_da_args_t
*
args
,
xfs_dablk_t
dead_blkno
,
int
xfs_da_shrink_inode
(
xfs_da_args_t
*
args
,
xfs_dablk_t
dead_blkno
,
xfs_dabuf_t
*
dead_buf
);
xfs_dabuf_t
*
dead_buf
);
uint
xfs_da_hashname
(
const
uchar
_t
*
name_string
,
int
name_length
);
uint
xfs_da_hashname
(
const
__uint8
_t
*
name_string
,
int
name_length
);
enum
xfs_dacmp
xfs_da_compname
(
struct
xfs_da_args
*
args
,
enum
xfs_dacmp
xfs_da_compname
(
struct
xfs_da_args
*
args
,
const
char
*
name
,
int
len
);
const
char
*
name
,
int
len
);
...
...
fs/xfs/xfs_ialloc.c
浏览文件 @
8e08f6eb
...
@@ -230,7 +230,7 @@ xfs_ialloc_ag_alloc(
...
@@ -230,7 +230,7 @@ xfs_ialloc_ag_alloc(
args
.
minalignslop
=
xfs_ialloc_cluster_alignment
(
&
args
)
-
1
;
args
.
minalignslop
=
xfs_ialloc_cluster_alignment
(
&
args
)
-
1
;
/* Allow space for the inode btree to split. */
/* Allow space for the inode btree to split. */
args
.
minleft
=
XFS_IN_MAXLEVELS
(
args
.
mp
)
-
1
;
args
.
minleft
=
args
.
mp
->
m_in_maxlevels
-
1
;
if
((
error
=
xfs_alloc_vextent
(
&
args
)))
if
((
error
=
xfs_alloc_vextent
(
&
args
)))
return
error
;
return
error
;
}
else
}
else
...
@@ -270,7 +270,7 @@ xfs_ialloc_ag_alloc(
...
@@ -270,7 +270,7 @@ xfs_ialloc_ag_alloc(
/*
/*
* Allow space for the inode btree to split.
* Allow space for the inode btree to split.
*/
*/
args
.
minleft
=
XFS_IN_MAXLEVELS
(
args
.
mp
)
-
1
;
args
.
minleft
=
args
.
mp
->
m_in_maxlevels
-
1
;
if
((
error
=
xfs_alloc_vextent
(
&
args
)))
if
((
error
=
xfs_alloc_vextent
(
&
args
)))
return
error
;
return
error
;
}
}
...
@@ -943,7 +943,7 @@ xfs_dialloc(
...
@@ -943,7 +943,7 @@ xfs_dialloc(
ASSERT
((
XFS_AGINO_TO_OFFSET
(
mp
,
rec
.
ir_startino
)
%
ASSERT
((
XFS_AGINO_TO_OFFSET
(
mp
,
rec
.
ir_startino
)
%
XFS_INODES_PER_CHUNK
)
==
0
);
XFS_INODES_PER_CHUNK
)
==
0
);
ino
=
XFS_AGINO_TO_INO
(
mp
,
agno
,
rec
.
ir_startino
+
offset
);
ino
=
XFS_AGINO_TO_INO
(
mp
,
agno
,
rec
.
ir_startino
+
offset
);
XFS_INOBT_CLR_FREE
(
&
rec
,
offset
);
rec
.
ir_free
&=
~
XFS_INOBT_MASK
(
offset
);
rec
.
ir_freecount
--
;
rec
.
ir_freecount
--
;
if
((
error
=
xfs_inobt_update
(
cur
,
rec
.
ir_startino
,
rec
.
ir_freecount
,
if
((
error
=
xfs_inobt_update
(
cur
,
rec
.
ir_startino
,
rec
.
ir_freecount
,
rec
.
ir_free
)))
rec
.
ir_free
)))
...
@@ -1105,11 +1105,11 @@ xfs_difree(
...
@@ -1105,11 +1105,11 @@ xfs_difree(
*/
*/
off
=
agino
-
rec
.
ir_startino
;
off
=
agino
-
rec
.
ir_startino
;
ASSERT
(
off
>=
0
&&
off
<
XFS_INODES_PER_CHUNK
);
ASSERT
(
off
>=
0
&&
off
<
XFS_INODES_PER_CHUNK
);
ASSERT
(
!
XFS_INOBT_IS_FREE
(
&
rec
,
off
));
ASSERT
(
!
(
rec
.
ir_free
&
XFS_INOBT_MASK
(
off
)
));
/*
/*
* Mark the inode free & increment the count.
* Mark the inode free & increment the count.
*/
*/
XFS_INOBT_SET_FREE
(
&
rec
,
off
);
rec
.
ir_free
|=
XFS_INOBT_MASK
(
off
);
rec
.
ir_freecount
++
;
rec
.
ir_freecount
++
;
/*
/*
...
...
fs/xfs/xfs_ialloc_btree.h
浏览文件 @
8e08f6eb
...
@@ -32,14 +32,14 @@ struct xfs_mount;
...
@@ -32,14 +32,14 @@ struct xfs_mount;
#define XFS_IBT_MAGIC 0x49414254
/* 'IABT' */
#define XFS_IBT_MAGIC 0x49414254
/* 'IABT' */
typedef
__uint64_t
xfs_inofree_t
;
typedef
__uint64_t
xfs_inofree_t
;
#define XFS_INODES_PER_CHUNK (NBBY * sizeof(xfs_inofree_t))
#define XFS_INODES_PER_CHUNK
(NBBY * sizeof(xfs_inofree_t))
#define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3)
#define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3)
#define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1)
#define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1)
#define XFS_INOBT_MASK(i) ((xfs_inofree_t)1 << (i))
static
inline
xfs_inofree_t
xfs_inobt_maskn
(
int
i
,
int
n
)
static
inline
xfs_inofree_t
xfs_inobt_maskn
(
int
i
,
int
n
)
{
{
return
(((
n
)
>=
XFS_INODES_PER_CHUNK
?
\
return
((
n
>=
XFS_INODES_PER_CHUNK
?
0
:
XFS_INOBT_MASK
(
n
))
-
1
)
<<
i
;
(
xfs_inofree_t
)
0
:
((
xfs_inofree_t
)
1
<<
(
n
)))
-
1
)
<<
(
i
);
}
}
/*
/*
...
@@ -68,20 +68,6 @@ typedef struct xfs_inobt_key {
...
@@ -68,20 +68,6 @@ typedef struct xfs_inobt_key {
/* btree pointer type */
/* btree pointer type */
typedef
__be32
xfs_inobt_ptr_t
;
typedef
__be32
xfs_inobt_ptr_t
;
/*
* Bit manipulations for ir_free.
*/
#define XFS_INOBT_MASK(i) ((xfs_inofree_t)1 << (i))
#define XFS_INOBT_IS_FREE(rp,i) \
(((rp)->ir_free & XFS_INOBT_MASK(i)) != 0)
#define XFS_INOBT_SET_FREE(rp,i) ((rp)->ir_free |= XFS_INOBT_MASK(i))
#define XFS_INOBT_CLR_FREE(rp,i) ((rp)->ir_free &= ~XFS_INOBT_MASK(i))
/*
* Maximum number of inode btree levels.
*/
#define XFS_IN_MAXLEVELS(mp) ((mp)->m_in_maxlevels)
/*
/*
* block numbers in the AG.
* block numbers in the AG.
*/
*/
...
...
fs/xfs/xfs_log.c
浏览文件 @
8e08f6eb
...
@@ -1164,32 +1164,8 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
...
@@ -1164,32 +1164,8 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
log
->
l_iclog_hsize
=
BBSIZE
;
log
->
l_iclog_hsize
=
BBSIZE
;
log
->
l_iclog_heads
=
1
;
log
->
l_iclog_heads
=
1
;
/*
done:
* For 16KB, we use 3 32KB buffers. For 32KB block sizes, we use
/* are we being asked to make the sizes selected above visible? */
* 4 32KB buffers. For 64KB block sizes, we use 8 32KB buffers.
*/
if
(
mp
->
m_sb
.
sb_blocksize
>=
16
*
1024
)
{
log
->
l_iclog_size
=
XLOG_BIG_RECORD_BSIZE
;
log
->
l_iclog_size_log
=
XLOG_BIG_RECORD_BSHIFT
;
if
(
mp
->
m_logbufs
<=
0
)
{
switch
(
mp
->
m_sb
.
sb_blocksize
)
{
case
16
*
1024
:
/* 16 KB */
log
->
l_iclog_bufs
=
3
;
break
;
case
32
*
1024
:
/* 32 KB */
log
->
l_iclog_bufs
=
4
;
break
;
case
64
*
1024
:
/* 64 KB */
log
->
l_iclog_bufs
=
8
;
break
;
default:
xlog_panic
(
"XFS: Invalid blocksize"
);
break
;
}
}
}
done:
/* are we being asked to make the sizes selected above visible? */
if
(
mp
->
m_logbufs
==
0
)
if
(
mp
->
m_logbufs
==
0
)
mp
->
m_logbufs
=
log
->
l_iclog_bufs
;
mp
->
m_logbufs
=
log
->
l_iclog_bufs
;
if
(
mp
->
m_logbsize
==
0
)
if
(
mp
->
m_logbsize
==
0
)
...
...
fs/xfs/xfs_log_priv.h
浏览文件 @
8e08f6eb
...
@@ -359,7 +359,7 @@ typedef struct xlog_in_core {
...
@@ -359,7 +359,7 @@ typedef struct xlog_in_core {
int
ic_size
;
int
ic_size
;
int
ic_offset
;
int
ic_offset
;
int
ic_bwritecnt
;
int
ic_bwritecnt
;
u
short_
t
ic_state
;
u
nsigned
shor
t
ic_state
;
char
*
ic_datap
;
/* pointer to iclog data */
char
*
ic_datap
;
/* pointer to iclog data */
#ifdef XFS_LOG_TRACE
#ifdef XFS_LOG_TRACE
struct
ktrace
*
ic_trace
;
struct
ktrace
*
ic_trace
;
...
...
fs/xfs/xfs_log_recover.c
浏览文件 @
8e08f6eb
...
@@ -211,11 +211,11 @@ xlog_header_check_dump(
...
@@ -211,11 +211,11 @@ xlog_header_check_dump(
cmn_err
(
CE_DEBUG
,
"%s: SB : uuid = "
,
__func__
);
cmn_err
(
CE_DEBUG
,
"%s: SB : uuid = "
,
__func__
);
for
(
b
=
0
;
b
<
16
;
b
++
)
for
(
b
=
0
;
b
<
16
;
b
++
)
cmn_err
(
CE_DEBUG
,
"%02x"
,
((
uchar
_t
*
)
&
mp
->
m_sb
.
sb_uuid
)[
b
]);
cmn_err
(
CE_DEBUG
,
"%02x"
,
((
__uint8
_t
*
)
&
mp
->
m_sb
.
sb_uuid
)[
b
]);
cmn_err
(
CE_DEBUG
,
", fmt = %d
\n
"
,
XLOG_FMT
);
cmn_err
(
CE_DEBUG
,
", fmt = %d
\n
"
,
XLOG_FMT
);
cmn_err
(
CE_DEBUG
,
" log : uuid = "
);
cmn_err
(
CE_DEBUG
,
" log : uuid = "
);
for
(
b
=
0
;
b
<
16
;
b
++
)
for
(
b
=
0
;
b
<
16
;
b
++
)
cmn_err
(
CE_DEBUG
,
"%02x"
,
((
uchar
_t
*
)
&
head
->
h_fs_uuid
)[
b
]);
cmn_err
(
CE_DEBUG
,
"%02x"
,
((
__uint8
_t
*
)
&
head
->
h_fs_uuid
)[
b
]);
cmn_err
(
CE_DEBUG
,
", fmt = %d
\n
"
,
be32_to_cpu
(
head
->
h_fmt
));
cmn_err
(
CE_DEBUG
,
", fmt = %d
\n
"
,
be32_to_cpu
(
head
->
h_fmt
));
}
}
#else
#else
...
...
fs/xfs/xfs_mount.h
浏览文件 @
8e08f6eb
...
@@ -136,7 +136,6 @@ typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *,
...
@@ -136,7 +136,6 @@ typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *,
struct
xfs_dquot
*
,
struct
xfs_dquot
*
,
uint
);
struct
xfs_dquot
*
,
struct
xfs_dquot
*
,
uint
);
typedef
void
(
*
xfs_dqstatvfs_t
)(
struct
xfs_inode
*
,
struct
kstatfs
*
);
typedef
void
(
*
xfs_dqstatvfs_t
)(
struct
xfs_inode
*
,
struct
kstatfs
*
);
typedef
int
(
*
xfs_dqsync_t
)(
struct
xfs_mount
*
,
int
flags
);
typedef
int
(
*
xfs_dqsync_t
)(
struct
xfs_mount
*
,
int
flags
);
typedef
int
(
*
xfs_quotactl_t
)(
struct
xfs_mount
*
,
int
,
int
,
xfs_caddr_t
);
typedef
struct
xfs_qmops
{
typedef
struct
xfs_qmops
{
xfs_qminit_t
xfs_qminit
;
xfs_qminit_t
xfs_qminit
;
...
@@ -154,7 +153,6 @@ typedef struct xfs_qmops {
...
@@ -154,7 +153,6 @@ typedef struct xfs_qmops {
xfs_dqvopchownresv_t
xfs_dqvopchownresv
;
xfs_dqvopchownresv_t
xfs_dqvopchownresv
;
xfs_dqstatvfs_t
xfs_dqstatvfs
;
xfs_dqstatvfs_t
xfs_dqstatvfs
;
xfs_dqsync_t
xfs_dqsync
;
xfs_dqsync_t
xfs_dqsync
;
xfs_quotactl_t
xfs_quotactl
;
struct
xfs_dqtrxops
*
xfs_dqtrxops
;
struct
xfs_dqtrxops
*
xfs_dqtrxops
;
}
xfs_qmops_t
;
}
xfs_qmops_t
;
...
@@ -188,8 +186,6 @@ typedef struct xfs_qmops {
...
@@ -188,8 +186,6 @@ typedef struct xfs_qmops {
(*(ip)->i_mount->m_qm_ops->xfs_dqstatvfs)(ip, statp)
(*(ip)->i_mount->m_qm_ops->xfs_dqstatvfs)(ip, statp)
#define XFS_QM_DQSYNC(mp, flags) \
#define XFS_QM_DQSYNC(mp, flags) \
(*(mp)->m_qm_ops->xfs_dqsync)(mp, flags)
(*(mp)->m_qm_ops->xfs_dqsync)(mp, flags)
#define XFS_QM_QUOTACTL(mp, cmd, id, addr) \
(*(mp)->m_qm_ops->xfs_quotactl)(mp, cmd, id, addr)
#ifdef HAVE_PERCPU_SB
#ifdef HAVE_PERCPU_SB
...
@@ -273,7 +269,7 @@ typedef struct xfs_mount {
...
@@ -273,7 +269,7 @@ typedef struct xfs_mount {
uint
m_inobt_mnr
[
2
];
/* min inobt btree records */
uint
m_inobt_mnr
[
2
];
/* min inobt btree records */
uint
m_ag_maxlevels
;
/* XFS_AG_MAXLEVELS */
uint
m_ag_maxlevels
;
/* XFS_AG_MAXLEVELS */
uint
m_bm_maxlevels
[
2
];
/* XFS_BM_MAXLEVELS */
uint
m_bm_maxlevels
[
2
];
/* XFS_BM_MAXLEVELS */
uint
m_in_maxlevels
;
/*
XFS_IN_MAXLEVELS
*/
uint
m_in_maxlevels
;
/*
max inobt btree levels.
*/
struct
xfs_perag
*
m_perag
;
/* per-ag accounting info */
struct
xfs_perag
*
m_perag
;
/* per-ag accounting info */
struct
rw_semaphore
m_peraglock
;
/* lock for m_perag (pointer) */
struct
rw_semaphore
m_peraglock
;
/* lock for m_perag (pointer) */
struct
mutex
m_growlock
;
/* growfs mutex */
struct
mutex
m_growlock
;
/* growfs mutex */
...
...
fs/xfs/xfs_qmops.c
浏览文件 @
8e08f6eb
...
@@ -126,7 +126,6 @@ static struct xfs_qmops xfs_qmcore_stub = {
...
@@ -126,7 +126,6 @@ static struct xfs_qmops xfs_qmcore_stub = {
.
xfs_dqvopchownresv
=
(
xfs_dqvopchownresv_t
)
fs_noerr
,
.
xfs_dqvopchownresv
=
(
xfs_dqvopchownresv_t
)
fs_noerr
,
.
xfs_dqstatvfs
=
(
xfs_dqstatvfs_t
)
fs_noval
,
.
xfs_dqstatvfs
=
(
xfs_dqstatvfs_t
)
fs_noval
,
.
xfs_dqsync
=
(
xfs_dqsync_t
)
fs_noerr
,
.
xfs_dqsync
=
(
xfs_dqsync_t
)
fs_noerr
,
.
xfs_quotactl
=
(
xfs_quotactl_t
)
fs_nosys
,
};
};
int
int
...
...
fs/xfs/xfs_quota.h
浏览文件 @
8e08f6eb
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
#ifndef __XFS_QUOTA_H__
#ifndef __XFS_QUOTA_H__
#define __XFS_QUOTA_H__
#define __XFS_QUOTA_H__
struct
xfs_trans
;
/*
/*
* The ondisk form of a dquot structure.
* The ondisk form of a dquot structure.
*/
*/
...
...
fs/xfs/xfs_trans.h
浏览文件 @
8e08f6eb
...
@@ -343,7 +343,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
...
@@ -343,7 +343,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
(128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4))) + \
(128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4))) + \
(128 * 5) + \
(128 * 5) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
XFS_IN_MAXLEVELS(mp)
+ \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
(mp)->m_in_maxlevels
+ \
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
#define XFS_ITRUNCATE_LOG_RES(mp) ((mp)->m_reservations.tr_itruncate)
#define XFS_ITRUNCATE_LOG_RES(mp) ((mp)->m_reservations.tr_itruncate)
...
@@ -449,9 +449,9 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
...
@@ -449,9 +449,9 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
(128 * (4 + XFS_DIROP_LOG_COUNT(mp)))), \
(128 * (4 + XFS_DIROP_LOG_COUNT(mp)))), \
(2 * (mp)->m_sb.sb_sectsize + \
(2 * (mp)->m_sb.sb_sectsize + \
XFS_FSB_TO_B((mp), XFS_IALLOC_BLOCKS((mp))) + \
XFS_FSB_TO_B((mp), XFS_IALLOC_BLOCKS((mp))) + \
XFS_FSB_TO_B((mp),
XFS_IN_MAXLEVELS(mp)
) + \
XFS_FSB_TO_B((mp),
(mp)->m_in_maxlevels
) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
XFS_IN_MAXLEVELS(mp)
+ \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
(mp)->m_in_maxlevels
+ \
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
#define XFS_SYMLINK_LOG_RES(mp) ((mp)->m_reservations.tr_symlink)
#define XFS_SYMLINK_LOG_RES(mp) ((mp)->m_reservations.tr_symlink)
...
@@ -481,9 +481,9 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
...
@@ -481,9 +481,9 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
(128 * (3 + XFS_DIROP_LOG_COUNT(mp)))), \
(128 * (3 + XFS_DIROP_LOG_COUNT(mp)))), \
(3 * (mp)->m_sb.sb_sectsize + \
(3 * (mp)->m_sb.sb_sectsize + \
XFS_FSB_TO_B((mp), XFS_IALLOC_BLOCKS((mp))) + \
XFS_FSB_TO_B((mp), XFS_IALLOC_BLOCKS((mp))) + \
XFS_FSB_TO_B((mp),
XFS_IN_MAXLEVELS(mp)
) + \
XFS_FSB_TO_B((mp),
(mp)->m_in_maxlevels
) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
XFS_IN_MAXLEVELS(mp)
+ \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
(mp)->m_in_maxlevels
+ \
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
#define XFS_CREATE_LOG_RES(mp) ((mp)->m_reservations.tr_create)
#define XFS_CREATE_LOG_RES(mp) ((mp)->m_reservations.tr_create)
...
@@ -513,7 +513,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
...
@@ -513,7 +513,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
MAX((__uint16_t)XFS_FSB_TO_B((mp), 1), XFS_INODE_CLUSTER_SIZE(mp)) + \
MAX((__uint16_t)XFS_FSB_TO_B((mp), 1), XFS_INODE_CLUSTER_SIZE(mp)) + \
(128 * 5) + \
(128 * 5) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
XFS_ALLOCFREE_LOG_RES(mp, 1) + \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
XFS_IN_MAXLEVELS(mp)
+ \
(128 * (2 + XFS_IALLOC_BLOCKS(mp) +
(mp)->m_in_maxlevels
+ \
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))
XFS_ALLOCFREE_LOG_COUNT(mp, 1))))
...
...
fs/xfs/xfs_trans_space.h
浏览文件 @
8e08f6eb
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
#define XFS_DIRREMOVE_SPACE_RES(mp) \
#define XFS_DIRREMOVE_SPACE_RES(mp) \
XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
#define XFS_IALLOC_SPACE_RES(mp) \
#define XFS_IALLOC_SPACE_RES(mp) \
(XFS_IALLOC_BLOCKS(mp) +
XFS_IN_MAXLEVELS(mp)-
1)
(XFS_IALLOC_BLOCKS(mp) +
(mp)->m_in_maxlevels -
1)
/*
/*
* Space reservation values for various transactions.
* Space reservation values for various transactions.
...
...
fs/xfs/xfs_types.h
浏览文件 @
8e08f6eb
...
@@ -20,14 +20,6 @@
...
@@ -20,14 +20,6 @@
#ifdef __KERNEL__
#ifdef __KERNEL__
/*
* POSIX Extensions
*/
typedef
unsigned
char
uchar_t
;
typedef
unsigned
short
ushort_t
;
typedef
unsigned
int
uint_t
;
typedef
unsigned
long
ulong_t
;
/*
/*
* Additional type declarations for XFS
* Additional type declarations for XFS
*/
*/
...
...
fs/xfs/xfs_vnodeops.c
浏览文件 @
8e08f6eb
...
@@ -1387,23 +1387,28 @@ xfs_create(
...
@@ -1387,23 +1387,28 @@ xfs_create(
xfs_inode_t
**
ipp
,
xfs_inode_t
**
ipp
,
cred_t
*
credp
)
cred_t
*
credp
)
{
{
xfs_mount_t
*
mp
=
dp
->
i_mount
;
int
is_dir
=
S_ISDIR
(
mode
);
xfs_inode_t
*
ip
;
struct
xfs_mount
*
mp
=
dp
->
i_mount
;
xfs_trans_t
*
tp
;
struct
xfs_inode
*
ip
=
NULL
;
struct
xfs_trans
*
tp
=
NULL
;
int
error
;
int
error
;
xfs_bmap_free_t
free_list
;
xfs_bmap_free_t
free_list
;
xfs_fsblock_t
first_block
;
xfs_fsblock_t
first_block
;
boolean_t
unlock_dp_on_error
=
B_FALSE
;
boolean_t
unlock_dp_on_error
=
B_FALSE
;
int
dm_event_sent
=
0
;
uint
cancel_flags
;
uint
cancel_flags
;
int
committed
;
int
committed
;
xfs_prid_t
prid
;
xfs_prid_t
prid
;
struct
xfs_dquot
*
udqp
,
*
gdqp
;
struct
xfs_dquot
*
udqp
=
NULL
;
struct
xfs_dquot
*
gdqp
=
NULL
;
uint
resblks
;
uint
resblks
;
uint
log_res
;
uint
log_count
;
ASSERT
(
!*
ipp
);
xfs_itrace_entry
(
dp
);
xfs_itrace_entry
(
dp
);
if
(
XFS_FORCED_SHUTDOWN
(
mp
))
return
XFS_ERROR
(
EIO
);
if
(
DM_EVENT_ENABLED
(
dp
,
DM_EVENT_CREATE
))
{
if
(
DM_EVENT_ENABLED
(
dp
,
DM_EVENT_CREATE
))
{
error
=
XFS_SEND_NAMESP
(
mp
,
DM_EVENT_CREATE
,
error
=
XFS_SEND_NAMESP
(
mp
,
DM_EVENT_CREATE
,
dp
,
DM_RIGHT_NULL
,
NULL
,
dp
,
DM_RIGHT_NULL
,
NULL
,
...
@@ -1412,84 +1417,97 @@ xfs_create(
...
@@ -1412,84 +1417,97 @@ xfs_create(
if
(
error
)
if
(
error
)
return
error
;
return
error
;
dm_event_sent
=
1
;
}
}
if
(
XFS_FORCED_SHUTDOWN
(
mp
))
return
XFS_ERROR
(
EIO
);
/* Return through std_return after this point. */
udqp
=
gdqp
=
NULL
;
if
(
dp
->
i_d
.
di_flags
&
XFS_DIFLAG_PROJINHERIT
)
if
(
dp
->
i_d
.
di_flags
&
XFS_DIFLAG_PROJINHERIT
)
prid
=
dp
->
i_d
.
di_projid
;
prid
=
dp
->
i_d
.
di_projid
;
else
else
prid
=
(
xfs_prid_t
)
dfltprid
;
prid
=
dfltprid
;
/*
/*
* Make sure that we have allocated dquot(s) on disk.
* Make sure that we have allocated dquot(s) on disk.
*/
*/
error
=
XFS_QM_DQVOPALLOC
(
mp
,
dp
,
error
=
XFS_QM_DQVOPALLOC
(
mp
,
dp
,
current_fsuid
(),
current_fsgid
(),
prid
,
current_fsuid
(),
current_fsgid
(),
prid
,
XFS_QMOPT_QUOTALL
|
XFS_QMOPT_INHERIT
,
&
udqp
,
&
gdqp
);
XFS_QMOPT_QUOTALL
|
XFS_QMOPT_INHERIT
,
&
udqp
,
&
gdqp
);
if
(
error
)
if
(
error
)
goto
std_return
;
goto
std_return
;
ip
=
NULL
;
if
(
is_dir
)
{
rdev
=
0
;
resblks
=
XFS_MKDIR_SPACE_RES
(
mp
,
name
->
len
);
log_res
=
XFS_MKDIR_LOG_RES
(
mp
);
log_count
=
XFS_MKDIR_LOG_COUNT
;
tp
=
xfs_trans_alloc
(
mp
,
XFS_TRANS_MKDIR
);
}
else
{
resblks
=
XFS_CREATE_SPACE_RES
(
mp
,
name
->
len
);
log_res
=
XFS_CREATE_LOG_RES
(
mp
);
log_count
=
XFS_CREATE_LOG_COUNT
;
tp
=
xfs_trans_alloc
(
mp
,
XFS_TRANS_CREATE
);
}
tp
=
xfs_trans_alloc
(
mp
,
XFS_TRANS_CREATE
);
cancel_flags
=
XFS_TRANS_RELEASE_LOG_RES
;
cancel_flags
=
XFS_TRANS_RELEASE_LOG_RES
;
resblks
=
XFS_CREATE_SPACE_RES
(
mp
,
name
->
len
);
/*
/*
* Initially assume that the file does not exist and
* Initially assume that the file does not exist and
* reserve the resources for that case. If that is not
* reserve the resources for that case. If that is not
* the case we'll drop the one we have and get a more
* the case we'll drop the one we have and get a more
* appropriate transaction later.
* appropriate transaction later.
*/
*/
error
=
xfs_trans_reserve
(
tp
,
resblks
,
XFS_CREATE_LOG_RES
(
mp
)
,
0
,
error
=
xfs_trans_reserve
(
tp
,
resblks
,
log_res
,
0
,
XFS_TRANS_PERM_LOG_RES
,
XFS_CREATE_LOG_COUNT
);
XFS_TRANS_PERM_LOG_RES
,
log_count
);
if
(
error
==
ENOSPC
)
{
if
(
error
==
ENOSPC
)
{
resblks
=
0
;
resblks
=
0
;
error
=
xfs_trans_reserve
(
tp
,
0
,
XFS_CREATE_LOG_RES
(
mp
)
,
0
,
error
=
xfs_trans_reserve
(
tp
,
0
,
log_res
,
0
,
XFS_TRANS_PERM_LOG_RES
,
XFS_CREATE_LOG_COUNT
);
XFS_TRANS_PERM_LOG_RES
,
log_count
);
}
}
if
(
error
)
{
if
(
error
)
{
cancel_flags
=
0
;
cancel_flags
=
0
;
goto
error_return
;
goto
out_trans_cancel
;
}
}
xfs_ilock
(
dp
,
XFS_ILOCK_EXCL
|
XFS_ILOCK_PARENT
);
xfs_ilock
(
dp
,
XFS_ILOCK_EXCL
|
XFS_ILOCK_PARENT
);
unlock_dp_on_error
=
B_TRUE
;
unlock_dp_on_error
=
B_TRUE
;
xfs_bmap_init
(
&
free_list
,
&
first_block
);
/*
* Check for directory link count overflow.
*/
if
(
is_dir
&&
dp
->
i_d
.
di_nlink
>=
XFS_MAXLINK
)
{
error
=
XFS_ERROR
(
EMLINK
);
goto
out_trans_cancel
;
}
ASSERT
(
ip
==
NULL
);
xfs_bmap_init
(
&
free_list
,
&
first_block
);
/*
/*
* Reserve disk quota and the inode.
* Reserve disk quota and the inode.
*/
*/
error
=
XFS_TRANS_RESERVE_QUOTA
(
mp
,
tp
,
udqp
,
gdqp
,
resblks
,
1
,
0
);
error
=
XFS_TRANS_RESERVE_QUOTA
(
mp
,
tp
,
udqp
,
gdqp
,
resblks
,
1
,
0
);
if
(
error
)
if
(
error
)
goto
error_return
;
goto
out_trans_cancel
;
error
=
xfs_dir_canenter
(
tp
,
dp
,
name
,
resblks
);
error
=
xfs_dir_canenter
(
tp
,
dp
,
name
,
resblks
);
if
(
error
)
if
(
error
)
goto
error_return
;
goto
out_trans_cancel
;
error
=
xfs_dir_ialloc
(
&
tp
,
dp
,
mode
,
1
,
rdev
,
credp
,
prid
,
resblks
>
0
,
/*
&
ip
,
&
committed
);
* A newly created regular or special file just has one directory
* entry pointing to them, but a directory also the "." entry
* pointing to itself.
*/
error
=
xfs_dir_ialloc
(
&
tp
,
dp
,
mode
,
is_dir
?
2
:
1
,
rdev
,
credp
,
prid
,
resblks
>
0
,
&
ip
,
&
committed
);
if
(
error
)
{
if
(
error
)
{
if
(
error
==
ENOSPC
)
if
(
error
==
ENOSPC
)
goto
error_return
;
goto
out_trans_cancel
;
goto
abort_return
;
goto
out_trans_abort
;
}
}
xfs_itrace_ref
(
ip
);
/*
/*
* At this point, we've gotten a newly allocated inode.
* At this point, we've gotten a newly allocated inode.
* It is locked (and joined to the transaction).
* It is locked (and joined to the transaction).
*/
*/
xfs_itrace_ref
(
ip
);
ASSERT
(
xfs_isilocked
(
ip
,
XFS_ILOCK_EXCL
));
ASSERT
(
xfs_isilocked
(
ip
,
XFS_ILOCK_EXCL
));
/*
/*
...
@@ -1508,19 +1526,28 @@ xfs_create(
...
@@ -1508,19 +1526,28 @@ xfs_create(
resblks
-
XFS_IALLOC_SPACE_RES
(
mp
)
:
0
);
resblks
-
XFS_IALLOC_SPACE_RES
(
mp
)
:
0
);
if
(
error
)
{
if
(
error
)
{
ASSERT
(
error
!=
ENOSPC
);
ASSERT
(
error
!=
ENOSPC
);
goto
abort_return
;
goto
out_trans_abort
;
}
}
xfs_ichgtime
(
dp
,
XFS_ICHGTIME_MOD
|
XFS_ICHGTIME_CHG
);
xfs_ichgtime
(
dp
,
XFS_ICHGTIME_MOD
|
XFS_ICHGTIME_CHG
);
xfs_trans_log_inode
(
tp
,
dp
,
XFS_ILOG_CORE
);
xfs_trans_log_inode
(
tp
,
dp
,
XFS_ILOG_CORE
);
if
(
is_dir
)
{
error
=
xfs_dir_init
(
tp
,
ip
,
dp
);
if
(
error
)
goto
out_bmap_cancel
;
error
=
xfs_bumplink
(
tp
,
dp
);
if
(
error
)
goto
out_bmap_cancel
;
}
/*
/*
* If this is a synchronous mount, make sure that the
* If this is a synchronous mount, make sure that the
* create transaction goes to disk before returning to
* create transaction goes to disk before returning to
* the user.
* the user.
*/
*/
if
(
mp
->
m_flags
&
(
XFS_MOUNT_WSYNC
|
XFS_MOUNT_DIRSYNC
))
{
if
(
mp
->
m_flags
&
(
XFS_MOUNT_WSYNC
|
XFS_MOUNT_DIRSYNC
))
xfs_trans_set_sync
(
tp
);
xfs_trans_set_sync
(
tp
);
}
/*
/*
* Attach the dquot(s) to the inodes and modify them incore.
* Attach the dquot(s) to the inodes and modify them incore.
...
@@ -1537,16 +1564,13 @@ xfs_create(
...
@@ -1537,16 +1564,13 @@ xfs_create(
IHOLD
(
ip
);
IHOLD
(
ip
);
error
=
xfs_bmap_finish
(
&
tp
,
&
free_list
,
&
committed
);
error
=
xfs_bmap_finish
(
&
tp
,
&
free_list
,
&
committed
);
if
(
error
)
{
if
(
error
)
xfs_bmap_cancel
(
&
free_list
);
goto
out_abort_rele
;
goto
abort_rele
;
}
error
=
xfs_trans_commit
(
tp
,
XFS_TRANS_RELEASE_LOG_RES
);
error
=
xfs_trans_commit
(
tp
,
XFS_TRANS_RELEASE_LOG_RES
);
if
(
error
)
{
if
(
error
)
{
IRELE
(
ip
);
IRELE
(
ip
);
tp
=
NULL
;
goto
out_dqrele
;
goto
error_return
;
}
}
XFS_QM_DQRELE
(
mp
,
udqp
);
XFS_QM_DQRELE
(
mp
,
udqp
);
...
@@ -1555,26 +1579,22 @@ xfs_create(
...
@@ -1555,26 +1579,22 @@ xfs_create(
*
ipp
=
ip
;
*
ipp
=
ip
;
/* Fallthrough to std_return with error = 0 */
/* Fallthrough to std_return with error = 0 */
std_return:
std_return:
if
(
DM_EVENT_ENABLED
(
dp
,
DM_EVENT_POSTCREATE
))
{
if
((
*
ipp
||
(
error
!=
0
&&
dm_event_sent
!=
0
))
&&
XFS_SEND_NAMESP
(
mp
,
DM_EVENT_POSTCREATE
,
dp
,
DM_RIGHT_NULL
,
DM_EVENT_ENABLED
(
dp
,
DM_EVENT_POSTCREATE
))
{
ip
,
DM_RIGHT_NULL
,
name
->
name
,
NULL
,
mode
,
(
void
)
XFS_SEND_NAMESP
(
mp
,
DM_EVENT_POSTCREATE
,
error
,
0
);
dp
,
DM_RIGHT_NULL
,
*
ipp
?
ip
:
NULL
,
DM_RIGHT_NULL
,
name
->
name
,
NULL
,
mode
,
error
,
0
);
}
}
return
error
;
return
error
;
abort_return:
out_bmap_cancel:
xfs_bmap_cancel
(
&
free_list
);
out_trans_abort:
cancel_flags
|=
XFS_TRANS_ABORT
;
cancel_flags
|=
XFS_TRANS_ABORT
;
/* FALLTHROUGH */
out_trans_cancel:
xfs_trans_cancel
(
tp
,
cancel_flags
);
error_return:
out_dqrele:
if
(
tp
!=
NULL
)
xfs_trans_cancel
(
tp
,
cancel_flags
);
XFS_QM_DQRELE
(
mp
,
udqp
);
XFS_QM_DQRELE
(
mp
,
udqp
);
XFS_QM_DQRELE
(
mp
,
gdqp
);
XFS_QM_DQRELE
(
mp
,
gdqp
);
...
@@ -1583,20 +1603,18 @@ xfs_create(
...
@@ -1583,20 +1603,18 @@ xfs_create(
goto
std_return
;
goto
std_return
;
abort_rele:
out_
abort_rele:
/*
/*
* Wait until after the current transaction is aborted to
* Wait until after the current transaction is aborted to
* release the inode. This prevents recursive transactions
* release the inode. This prevents recursive transactions
* and deadlocks from xfs_inactive.
* and deadlocks from xfs_inactive.
*/
*/
xfs_bmap_cancel
(
&
free_list
);
cancel_flags
|=
XFS_TRANS_ABORT
;
cancel_flags
|=
XFS_TRANS_ABORT
;
xfs_trans_cancel
(
tp
,
cancel_flags
);
xfs_trans_cancel
(
tp
,
cancel_flags
);
IRELE
(
ip
);
IRELE
(
ip
);
unlock_dp_on_error
=
B_FALSE
;
XFS_QM_DQRELE
(
mp
,
udqp
);
goto
out_dqrele
;
XFS_QM_DQRELE
(
mp
,
gdqp
);
goto
std_return
;
}
}
#ifdef DEBUG
#ifdef DEBUG
...
@@ -2112,209 +2130,6 @@ xfs_link(
...
@@ -2112,209 +2130,6 @@ xfs_link(
goto
std_return
;
goto
std_return
;
}
}
int
xfs_mkdir
(
xfs_inode_t
*
dp
,
struct
xfs_name
*
dir_name
,
mode_t
mode
,
xfs_inode_t
**
ipp
,
cred_t
*
credp
)
{
xfs_mount_t
*
mp
=
dp
->
i_mount
;
xfs_inode_t
*
cdp
;
/* inode of created dir */
xfs_trans_t
*
tp
;
int
cancel_flags
;
int
error
;
int
committed
;
xfs_bmap_free_t
free_list
;
xfs_fsblock_t
first_block
;
boolean_t
unlock_dp_on_error
=
B_FALSE
;
boolean_t
created
=
B_FALSE
;
int
dm_event_sent
=
0
;
xfs_prid_t
prid
;
struct
xfs_dquot
*
udqp
,
*
gdqp
;
uint
resblks
;
if
(
XFS_FORCED_SHUTDOWN
(
mp
))
return
XFS_ERROR
(
EIO
);
tp
=
NULL
;
if
(
DM_EVENT_ENABLED
(
dp
,
DM_EVENT_CREATE
))
{
error
=
XFS_SEND_NAMESP
(
mp
,
DM_EVENT_CREATE
,
dp
,
DM_RIGHT_NULL
,
NULL
,
DM_RIGHT_NULL
,
dir_name
->
name
,
NULL
,
mode
,
0
,
0
);
if
(
error
)
return
error
;
dm_event_sent
=
1
;
}
/* Return through std_return after this point. */
xfs_itrace_entry
(
dp
);
mp
=
dp
->
i_mount
;
udqp
=
gdqp
=
NULL
;
if
(
dp
->
i_d
.
di_flags
&
XFS_DIFLAG_PROJINHERIT
)
prid
=
dp
->
i_d
.
di_projid
;
else
prid
=
(
xfs_prid_t
)
dfltprid
;
/*
* Make sure that we have allocated dquot(s) on disk.
*/
error
=
XFS_QM_DQVOPALLOC
(
mp
,
dp
,
current_fsuid
(),
current_fsgid
(),
prid
,
XFS_QMOPT_QUOTALL
|
XFS_QMOPT_INHERIT
,
&
udqp
,
&
gdqp
);
if
(
error
)
goto
std_return
;
tp
=
xfs_trans_alloc
(
mp
,
XFS_TRANS_MKDIR
);
cancel_flags
=
XFS_TRANS_RELEASE_LOG_RES
;
resblks
=
XFS_MKDIR_SPACE_RES
(
mp
,
dir_name
->
len
);
error
=
xfs_trans_reserve
(
tp
,
resblks
,
XFS_MKDIR_LOG_RES
(
mp
),
0
,
XFS_TRANS_PERM_LOG_RES
,
XFS_MKDIR_LOG_COUNT
);
if
(
error
==
ENOSPC
)
{
resblks
=
0
;
error
=
xfs_trans_reserve
(
tp
,
0
,
XFS_MKDIR_LOG_RES
(
mp
),
0
,
XFS_TRANS_PERM_LOG_RES
,
XFS_MKDIR_LOG_COUNT
);
}
if
(
error
)
{
cancel_flags
=
0
;
goto
error_return
;
}
xfs_ilock
(
dp
,
XFS_ILOCK_EXCL
|
XFS_ILOCK_PARENT
);
unlock_dp_on_error
=
B_TRUE
;
/*
* Check for directory link count overflow.
*/
if
(
dp
->
i_d
.
di_nlink
>=
XFS_MAXLINK
)
{
error
=
XFS_ERROR
(
EMLINK
);
goto
error_return
;
}
/*
* Reserve disk quota and the inode.
*/
error
=
XFS_TRANS_RESERVE_QUOTA
(
mp
,
tp
,
udqp
,
gdqp
,
resblks
,
1
,
0
);
if
(
error
)
goto
error_return
;
error
=
xfs_dir_canenter
(
tp
,
dp
,
dir_name
,
resblks
);
if
(
error
)
goto
error_return
;
/*
* create the directory inode.
*/
error
=
xfs_dir_ialloc
(
&
tp
,
dp
,
mode
,
2
,
0
,
credp
,
prid
,
resblks
>
0
,
&
cdp
,
NULL
);
if
(
error
)
{
if
(
error
==
ENOSPC
)
goto
error_return
;
goto
abort_return
;
}
xfs_itrace_ref
(
cdp
);
/*
* Now we add the directory inode to the transaction.
* We waited until now since xfs_dir_ialloc might start
* a new transaction. Had we joined the transaction
* earlier, the locks might have gotten released. An error
* from here on will result in the transaction cancel
* unlocking dp so don't do it explicitly in the error path.
*/
IHOLD
(
dp
);
xfs_trans_ijoin
(
tp
,
dp
,
XFS_ILOCK_EXCL
);
unlock_dp_on_error
=
B_FALSE
;
xfs_bmap_init
(
&
free_list
,
&
first_block
);
error
=
xfs_dir_createname
(
tp
,
dp
,
dir_name
,
cdp
->
i_ino
,
&
first_block
,
&
free_list
,
resblks
?
resblks
-
XFS_IALLOC_SPACE_RES
(
mp
)
:
0
);
if
(
error
)
{
ASSERT
(
error
!=
ENOSPC
);
goto
error1
;
}
xfs_ichgtime
(
dp
,
XFS_ICHGTIME_MOD
|
XFS_ICHGTIME_CHG
);
error
=
xfs_dir_init
(
tp
,
cdp
,
dp
);
if
(
error
)
goto
error2
;
error
=
xfs_bumplink
(
tp
,
dp
);
if
(
error
)
goto
error2
;
created
=
B_TRUE
;
*
ipp
=
cdp
;
IHOLD
(
cdp
);
/*
* Attach the dquots to the new inode and modify the icount incore.
*/
XFS_QM_DQVOPCREATE
(
mp
,
tp
,
cdp
,
udqp
,
gdqp
);
/*
* If this is a synchronous mount, make sure that the
* mkdir transaction goes to disk before returning to
* the user.
*/
if
(
mp
->
m_flags
&
(
XFS_MOUNT_WSYNC
|
XFS_MOUNT_DIRSYNC
))
{
xfs_trans_set_sync
(
tp
);
}
error
=
xfs_bmap_finish
(
&
tp
,
&
free_list
,
&
committed
);
if
(
error
)
{
IRELE
(
cdp
);
goto
error2
;
}
error
=
xfs_trans_commit
(
tp
,
XFS_TRANS_RELEASE_LOG_RES
);
XFS_QM_DQRELE
(
mp
,
udqp
);
XFS_QM_DQRELE
(
mp
,
gdqp
);
if
(
error
)
{
IRELE
(
cdp
);
}
/* Fall through to std_return with error = 0 or errno from
* xfs_trans_commit. */
std_return:
if
((
created
||
(
error
!=
0
&&
dm_event_sent
!=
0
))
&&
DM_EVENT_ENABLED
(
dp
,
DM_EVENT_POSTCREATE
))
{
(
void
)
XFS_SEND_NAMESP
(
mp
,
DM_EVENT_POSTCREATE
,
dp
,
DM_RIGHT_NULL
,
created
?
cdp
:
NULL
,
DM_RIGHT_NULL
,
dir_name
->
name
,
NULL
,
mode
,
error
,
0
);
}
return
error
;
error2:
error1:
xfs_bmap_cancel
(
&
free_list
);
abort_return:
cancel_flags
|=
XFS_TRANS_ABORT
;
error_return:
xfs_trans_cancel
(
tp
,
cancel_flags
);
XFS_QM_DQRELE
(
mp
,
udqp
);
XFS_QM_DQRELE
(
mp
,
gdqp
);
if
(
unlock_dp_on_error
)
xfs_iunlock
(
dp
,
XFS_ILOCK_EXCL
);
goto
std_return
;
}
int
int
xfs_symlink
(
xfs_symlink
(
xfs_inode_t
*
dp
,
xfs_inode_t
*
dp
,
...
...
fs/xfs/xfs_vnodeops.h
浏览文件 @
8e08f6eb
...
@@ -31,8 +31,6 @@ int xfs_remove(struct xfs_inode *dp, struct xfs_name *name,
...
@@ -31,8 +31,6 @@ int xfs_remove(struct xfs_inode *dp, struct xfs_name *name,
struct
xfs_inode
*
ip
);
struct
xfs_inode
*
ip
);
int
xfs_link
(
struct
xfs_inode
*
tdp
,
struct
xfs_inode
*
sip
,
int
xfs_link
(
struct
xfs_inode
*
tdp
,
struct
xfs_inode
*
sip
,
struct
xfs_name
*
target_name
);
struct
xfs_name
*
target_name
);
int
xfs_mkdir
(
struct
xfs_inode
*
dp
,
struct
xfs_name
*
dir_name
,
mode_t
mode
,
struct
xfs_inode
**
ipp
,
cred_t
*
credp
);
int
xfs_readdir
(
struct
xfs_inode
*
dp
,
void
*
dirent
,
size_t
bufsize
,
int
xfs_readdir
(
struct
xfs_inode
*
dp
,
void
*
dirent
,
size_t
bufsize
,
xfs_off_t
*
offset
,
filldir_t
filldir
);
xfs_off_t
*
offset
,
filldir_t
filldir
);
int
xfs_symlink
(
struct
xfs_inode
*
dp
,
struct
xfs_name
*
link_name
,
int
xfs_symlink
(
struct
xfs_inode
*
dp
,
struct
xfs_name
*
link_name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录