You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
xfs: kill xfs_vnodeops.[ch]
Now we have xfs_inode.c for holding kernel-only XFS inode operations, move all the inode operations from xfs_vnodeops.c to this new file as it holds another set of kernel-only inode operations. The name of this file traces back to the days of Irix and it's vnodes which we don't have anymore. Essentially this move consolidates the inode locking functions and a bunch of XFS inode operations into the one file. Eventually the high level functions will be merged into the VFS interface functions in xfs_iops.c. This leaves only internal preallocation, EOF block manipulation and hole punching functions in vnodeops.c. Move these to xfs_bmap_util.c where we are already consolidating various in-kernel physical extent manipulation and querying functions. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
This commit is contained in:
@@ -55,7 +55,6 @@ xfs-y += xfs_aops.o \
|
||||
xfs_symlink.o \
|
||||
xfs_trans.o \
|
||||
xfs_utils.o \
|
||||
xfs_vnodeops.o \
|
||||
xfs_xattr.o \
|
||||
kmem.o \
|
||||
uuid.o
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_bmap_btree.h"
|
||||
#include "xfs_inode.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_sb.h"
|
||||
#include "xfs_mount.h"
|
||||
#include "xfs_trace.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "xfs_alloc.h"
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_iomap.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_trace.h"
|
||||
#include "xfs_bmap.h"
|
||||
#include "xfs_bmap_util.h"
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_quota.h"
|
||||
#include "xfs_trans_space.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_trace.h"
|
||||
|
||||
/*
|
||||
|
||||
@@ -142,5 +142,13 @@ typedef struct xfs_attr_list_context {
|
||||
int xfs_attr_inactive(struct xfs_inode *dp);
|
||||
int xfs_attr_list_int(struct xfs_attr_list_context *);
|
||||
int xfs_inode_hasattr(struct xfs_inode *ip);
|
||||
int xfs_attr_get(struct xfs_inode *ip, const unsigned char *name,
|
||||
unsigned char *value, int *valuelenp, int flags);
|
||||
int xfs_attr_set(struct xfs_inode *dp, const unsigned char *name,
|
||||
unsigned char *value, int valuelen, int flags);
|
||||
int xfs_attr_remove(struct xfs_inode *dp, const unsigned char *name, int flags);
|
||||
int xfs_attr_list(struct xfs_inode *dp, char *buffer, int bufsize,
|
||||
int flags, struct attrlist_cursor_kern *cursor);
|
||||
|
||||
|
||||
#endif /* __XFS_ATTR_H__ */
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "xfs_trans_space.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_filestream.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_trace.h"
|
||||
#include "xfs_symlink.h"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,6 +21,7 @@
|
||||
/* Kernel only BMAP related definitions and functions */
|
||||
|
||||
struct xfs_bmbt_irec;
|
||||
struct xfs_bmap_free_item;
|
||||
struct xfs_ifork;
|
||||
struct xfs_inode;
|
||||
struct xfs_mount;
|
||||
@@ -91,6 +92,16 @@ int xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip,
|
||||
int whichfork, struct xfs_bmbt_irec *rec,
|
||||
int *is_empty);
|
||||
|
||||
/* preallocation and hole punch interface */
|
||||
int xfs_change_file_space(struct xfs_inode *ip, int cmd,
|
||||
xfs_flock64_t *bf, xfs_off_t offset,
|
||||
int attr_flags);
|
||||
|
||||
/* EOF block manipulation functions */
|
||||
bool xfs_can_free_eofblocks(struct xfs_inode *ip, bool force);
|
||||
int xfs_free_eofblocks(struct xfs_mount *mp, struct xfs_inode *ip,
|
||||
bool need_iolock);
|
||||
|
||||
xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb);
|
||||
|
||||
#endif /* __XFS_BMAP_UTIL_H__ */
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "xfs_itable.h"
|
||||
#include "xfs_dfrag.h"
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_trace.h"
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "xfs_dir2.h"
|
||||
#include "xfs_dir2_priv.h"
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_trace.h"
|
||||
|
||||
struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2};
|
||||
|
||||
@@ -62,12 +62,6 @@ extern int xfs_dir_canenter(struct xfs_trans *tp, struct xfs_inode *dp,
|
||||
*/
|
||||
extern int xfs_dir2_sf_to_block(struct xfs_da_args *args);
|
||||
|
||||
/*
|
||||
* Direct call on directory open, before entering the readdir code.
|
||||
*/
|
||||
extern int xfs_dir3_data_readahead(struct xfs_trans *tp, struct xfs_inode *dp,
|
||||
xfs_dablk_t bno, xfs_daddr_t mapped_bno);
|
||||
|
||||
/*
|
||||
* Interface routines used by userspace utilities
|
||||
*/
|
||||
|
||||
@@ -45,6 +45,8 @@ extern int xfs_dir2_leaf_to_block(struct xfs_da_args *args,
|
||||
extern int __xfs_dir3_data_check(struct xfs_inode *dp, struct xfs_buf *bp);
|
||||
extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
|
||||
xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
|
||||
extern int xfs_dir3_data_readahead(struct xfs_trans *tp, struct xfs_inode *dp,
|
||||
xfs_dablk_t bno, xfs_daddr_t mapped_bno);
|
||||
|
||||
extern struct xfs_dir2_data_free *
|
||||
xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,
|
||||
@@ -124,4 +126,8 @@ extern int xfs_dir2_sf_lookup(struct xfs_da_args *args);
|
||||
extern int xfs_dir2_sf_removename(struct xfs_da_args *args);
|
||||
extern int xfs_dir2_sf_replace(struct xfs_da_args *args);
|
||||
|
||||
/* xfs_dir2_readdir.c */
|
||||
extern int xfs_readdir(struct xfs_inode *dp, struct dir_context *ctx,
|
||||
size_t bufsize);
|
||||
|
||||
#endif /* __XFS_DIR2_PRIV_H__ */
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "xfs_dir2_format.h"
|
||||
#include "xfs_dir2.h"
|
||||
#include "xfs_export.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_bmap_btree.h"
|
||||
#include "xfs_inode.h"
|
||||
#include "xfs_inode_item.h"
|
||||
|
||||
+2
-1
@@ -28,11 +28,12 @@
|
||||
#include "xfs_inode.h"
|
||||
#include "xfs_inode_item.h"
|
||||
#include "xfs_bmap.h"
|
||||
#include "xfs_bmap_util.h"
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_da_btree.h"
|
||||
#include "xfs_dir2_format.h"
|
||||
#include "xfs_dir2.h"
|
||||
#include "xfs_dir2_priv.h"
|
||||
#include "xfs_ioctl.h"
|
||||
#include "xfs_trace.h"
|
||||
|
||||
|
||||
+1
-1
@@ -32,12 +32,12 @@
|
||||
#include "xfs_dinode.h"
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_filestream.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_inode_item.h"
|
||||
#include "xfs_quota.h"
|
||||
#include "xfs_trace.h"
|
||||
#include "xfs_fsops.h"
|
||||
#include "xfs_icache.h"
|
||||
#include "xfs_bmap_util.h"
|
||||
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
+967
-37
File diff suppressed because it is too large
Load Diff
+20
-3
@@ -315,9 +315,21 @@ static inline int xfs_isiflocked(struct xfs_inode *ip)
|
||||
((pip)->i_d.di_mode & S_ISGID))
|
||||
|
||||
|
||||
/*
|
||||
* xfs_inode.c prototypes.
|
||||
*/
|
||||
int xfs_release(struct xfs_inode *ip);
|
||||
int xfs_inactive(struct xfs_inode *ip);
|
||||
int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name,
|
||||
struct xfs_inode **ipp, struct xfs_name *ci_name);
|
||||
int xfs_create(struct xfs_inode *dp, struct xfs_name *name,
|
||||
umode_t mode, xfs_dev_t rdev, struct xfs_inode **ipp);
|
||||
int xfs_remove(struct xfs_inode *dp, struct xfs_name *name,
|
||||
struct xfs_inode *ip);
|
||||
int xfs_link(struct xfs_inode *tdp, struct xfs_inode *sip,
|
||||
struct xfs_name *target_name);
|
||||
int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name,
|
||||
struct xfs_inode *src_ip, struct xfs_inode *target_dp,
|
||||
struct xfs_name *target_name,
|
||||
struct xfs_inode *target_ip);
|
||||
|
||||
void xfs_ilock(xfs_inode_t *, uint);
|
||||
int xfs_ilock_nowait(xfs_inode_t *, uint);
|
||||
void xfs_iunlock(xfs_inode_t *, uint);
|
||||
@@ -348,6 +360,11 @@ void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
|
||||
|
||||
xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
|
||||
|
||||
/* from xfs_file.c */
|
||||
int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t);
|
||||
int xfs_iozero(struct xfs_inode *, loff_t, size_t);
|
||||
|
||||
|
||||
#define IHOLD(ip) \
|
||||
do { \
|
||||
ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
|
||||
|
||||
@@ -40,7 +40,6 @@ int xfs_iread(struct xfs_mount *, struct xfs_trans *,
|
||||
void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
|
||||
void xfs_dinode_to_disk(struct xfs_dinode *,
|
||||
struct xfs_icdinode *);
|
||||
bool xfs_can_free_eofblocks(struct xfs_inode *, bool);
|
||||
|
||||
#if defined(DEBUG)
|
||||
void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "xfs_utils.h"
|
||||
#include "xfs_quota.h"
|
||||
#include "xfs_filestream.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_cksum.h"
|
||||
#include "xfs_trace.h"
|
||||
#include "xfs_icache.h"
|
||||
|
||||
+35
-1
@@ -38,13 +38,13 @@
|
||||
#include "xfs_utils.h"
|
||||
#include "xfs_dfrag.h"
|
||||
#include "xfs_fsops.h"
|
||||
#include "xfs_vnodeops.h"
|
||||
#include "xfs_discard.h"
|
||||
#include "xfs_quota.h"
|
||||
#include "xfs_inode_item.h"
|
||||
#include "xfs_export.h"
|
||||
#include "xfs_trace.h"
|
||||
#include "xfs_icache.h"
|
||||
#include "xfs_symlink.h"
|
||||
|
||||
#include <linux/capability.h>
|
||||
#include <linux/dcache.h>
|
||||
@@ -352,6 +352,40 @@ xfs_readlink_by_handle(
|
||||
return error;
|
||||
}
|
||||
|
||||
int
|
||||
xfs_set_dmattrs(
|
||||
xfs_inode_t *ip,
|
||||
u_int evmask,
|
||||
u_int16_t state)
|
||||
{
|
||||
xfs_mount_t *mp = ip->i_mount;
|
||||
xfs_trans_t *tp;
|
||||
int error;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return XFS_ERROR(EPERM);
|
||||
|
||||
if (XFS_FORCED_SHUTDOWN(mp))
|
||||
return XFS_ERROR(EIO);
|
||||
|
||||
tp = xfs_trans_alloc(mp, XFS_TRANS_SET_DMATTRS);
|
||||
error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES (mp), 0, 0, 0);
|
||||
if (error) {
|
||||
xfs_trans_cancel(tp, 0);
|
||||
return error;
|
||||
}
|
||||
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
||||
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
|
||||
|
||||
ip->i_d.di_dmevmask = evmask;
|
||||
ip->i_d.di_dmstate = state;
|
||||
|
||||
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
||||
error = xfs_trans_commit(tp, 0);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
STATIC int
|
||||
xfs_fssetdm_by_handle(
|
||||
struct file *parfilp,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user