~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/nfs/nfs42.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (c) 2014 Anna Schumaker <Anna.Schumaker@Netapp.com>
  4  */
  5 
  6 #ifndef __LINUX_FS_NFS_NFS4_2_H
  7 #define __LINUX_FS_NFS_NFS4_2_H
  8 
  9 #include <linux/xattr.h>
 10 
 11 /*
 12  * FIXME:  four LAYOUTSTATS calls per compound at most! Do we need to support
 13  * more? Need to consider not to pre-alloc too much for a compound.
 14  */
 15 #define PNFS_LAYOUTSTATS_MAXDEV (4)
 16 #define READ_PLUS_SCRATCH_SIZE (16)
 17 
 18 /* nfs4.2proc.c */
 19 #ifdef CONFIG_NFS_V4_2
 20 int nfs42_proc_allocate(struct file *, loff_t, loff_t);
 21 ssize_t nfs42_proc_copy(struct file *, loff_t, struct file *, loff_t, size_t,
 22                         struct nl4_server *, nfs4_stateid *, bool);
 23 int nfs42_proc_deallocate(struct file *, loff_t, loff_t);
 24 loff_t nfs42_proc_llseek(struct file *, loff_t, int);
 25 int nfs42_proc_layoutstats_generic(struct nfs_server *,
 26                                    struct nfs42_layoutstat_data *);
 27 int nfs42_proc_clone(struct file *, struct file *, loff_t, loff_t, loff_t);
 28 int nfs42_proc_layouterror(struct pnfs_layout_segment *lseg,
 29                            const struct nfs42_layout_error *errors,
 30                            size_t n);
 31 int nfs42_proc_copy_notify(struct file *, struct file *,
 32                            struct nfs42_copy_notify_res *);
 33 static inline bool nfs42_files_from_same_server(struct file *in,
 34                                                 struct file *out)
 35 {
 36         struct nfs_client *c_in = (NFS_SERVER(file_inode(in)))->nfs_client;
 37         struct nfs_client *c_out = (NFS_SERVER(file_inode(out)))->nfs_client;
 38 
 39         return nfs4_check_serverowner_major_id(c_in->cl_serverowner,
 40                                                c_out->cl_serverowner);
 41 }
 42 
 43 ssize_t nfs42_proc_getxattr(struct inode *inode, const char *name,
 44                             void *buf, size_t buflen);
 45 int nfs42_proc_setxattr(struct inode *inode, const char *name,
 46                         const void *buf, size_t buflen, int flags);
 47 ssize_t nfs42_proc_listxattrs(struct inode *inode, void *buf,
 48                                size_t buflen, u64 *cookiep, bool *eofp);
 49 int nfs42_proc_removexattr(struct inode *inode, const char *name);
 50 
 51 /*
 52  * Maximum XDR buffer size needed for a listxattr buffer of buflen size.
 53  *
 54  * The upper boundary is a buffer with all 1-byte sized attribute names.
 55  * They would be 7 bytes long in the eventual buffer ("user.x\0"), and
 56  * 8 bytes long XDR-encoded.
 57  *
 58  * Include the trailing eof word as well and make the result a multiple
 59  * of 4 bytes.
 60  */
 61 static inline u32 nfs42_listxattr_xdrsize(u32 buflen)
 62 {
 63         u32 size = 8 * buflen / (XATTR_USER_PREFIX_LEN + 2) + 4;
 64 
 65         return (size + 3) & ~3;
 66 }
 67 #endif /* CONFIG_NFS_V4_2 */
 68 #endif /* __LINUX_FS_NFS_NFS4_2_H */
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php