/** * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * This source file is released under GPL v2 license (no other versions). * See the COPYING file included in the main directory of this source * distribution for the license terms and conditions. * * @File ctresource.h * * @Brief * This file contains the definition of generic hardware resources for * resource management. * * @Author Liu Chun * @Date May 13 2008 * */ #ifndef CTRESOURCE_H #define CTRESOURCE_H #include enum RSCTYP { SRC, SRCIMP, AMIXER, SUM, DAIO, NUM_RSCTYP /* This must be the last one and less than 16 */ }; struct rsc_ops; struct rsc { u32 idx:12; /* The index of a resource */ u32 type:4; /* The type (RSCTYP) of a resource */ u32 conj:12; /* Current conjugate index */ u32 msr:4; /* The Master Sample Rate a resource working on */ void *ctrl_blk; /* Chip specific control info block for a resource */ struct hw *hw; /* Chip specific object for hardware access means */ const struct rsc_ops *ops; /* Generic resource operations */ }; struct rsc_ops { int (*master)(struct rsc *rsc); /* Move to master resource */ int (*next_conj)(struct rsc *rsc); /* Move to next conjugate resource */ int (*index)(const struct rsc *rsc); /* Return the index of resource */ /* Return the output slot number */ int (*output_slot)(const struct rsc *rsc); }; int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw); int rsc_uninit(struct rsc *rsc); struct rsc_mgr { enum RSCTYP type; /* The type (RSCTYP) of resource to manage */ unsigned int amount; /* The total amount of a kind of resource */ unsigned int avail; /* The amount of currently available resources */ unsigned char *rscs; /* The bit-map for resource allocation */ void *ctrl_blk; /* Chip specific control info block */ struct hw *hw; /* Chip specific object for hardware access */ }; /* Resource management is based on bit-map mechanism */ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, unsigned int amount, struct hw *hw); int rsc_mgr_uninit(struct rsc_mgr *mgr); int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); #endif /* CTRESOURCE_H */ 'range'>range
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2013-05-21 16:53:03 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-05-17 15:47:55 -0400
commit2e72448b07dc3ff1b7593e9bfff91db182262857 (patch)
tree8dee05ff1743ef438fa53f85d980e1b3ddb12698
parent67911c8f18b595040f5c2df0550c69a7c9397891 (diff)
NFS: Add COPY nfs operation
This adds the copy_range file_ops function pointer used by the sys_copy_range() function call. This patch only implements sync copies, so if an async copy happens we decode the stateid and ignore it. Signed-off-by: Anna Schumaker <bjschuma@netapp.com>