Commit 19e8a2f8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull AFS updates from Al Viro:
 "The AFS series posted by dhowells depended upon lookup_one_len()
  rework; now that prereq is in the mainline, that series had been
  rebased on top of it and got some exposure and testing..."

* 'afs-dh' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  afs: Do better accretion of small writes on newly created content
  afs: Add stats for data transfer operations
  afs: Trace protocol errors
  afs: Locally edit directory data for mkdir/create/unlink/...
  afs: Adjust the directory XDR structures
  afs: Split the directory content defs into a header
  afs: Fix directory handling
  afs: Split the dynroot stuff out and give it its own ops tables
  afs: Keep track of invalid-before version for dentry coherency
  afs: Rearrange status mapping
  afs: Make it possible to get the data version in readpage
  afs: Init inode before accessing cache
  afs: Introduce a statistics proc file
  afs: Dump bad status record
  afs: Implement @cell substitution handling
  afs: Implement @sys substitution handling
  afs: Prospectively look up extra files when doing a single lookup
  afs: Don't over-increment the cell usage count when pinning it
  afs: Fix checker warnings
  vfs: Remove the const from dir_context::actor
parents 5d136594 5a813276
Loading
Loading
Loading
Loading
+27 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@ Contents:
 - Proc filesystem.
 - Proc filesystem.
 - The cell database.
 - The cell database.
 - Security.
 - Security.
 - Examples.
 - The @sys substitution.




========
========
@@ -230,3 +230,29 @@ If a file is opened with a particular key and then the file descriptor is
passed to a process that doesn't have that key (perhaps over an AF_UNIX
passed to a process that doesn't have that key (perhaps over an AF_UNIX
socket), then the operations on the file will be made with key that was used to
socket), then the operations on the file will be made with key that was used to
open the file.
open the file.


=====================
THE @SYS SUBSTITUTION
=====================

The list of up to 16 @sys substitutions for the current network namespace can
be configured by writing a list to /proc/fs/afs/sysname:

	[root@andromeda ~]# echo foo amd64_linux_26 >/proc/fs/afs/sysname

or cleared entirely by writing an empty list:

	[root@andromeda ~]# echo >/proc/fs/afs/sysname

The current list for current network namespace can be retrieved by:

	[root@andromeda ~]# cat /proc/fs/afs/sysname
	foo
	amd64_linux_26

When @sys is being substituted for, each element of the list is tried in the
order given.

By default, the list will contain one item that conforms to the pattern
"<arch>_linux_26", amd64 being the name for x86_64.
+2 −0
Original line number Original line Diff line number Diff line
@@ -12,6 +12,8 @@ kafs-objs := \
	cell.o \
	cell.o \
	cmservice.o \
	cmservice.o \
	dir.o \
	dir.o \
	dir_edit.o \
	dynroot.o \
	file.o \
	file.o \
	flock.o \
	flock.o \
	fsclient.o \
	fsclient.o \
+3 −3
Original line number Original line Diff line number Diff line
@@ -243,9 +243,9 @@ void afs_merge_fs_addr4(struct afs_addr_list *alist, __be32 xdr, u16 port)
		    xport == a->sin6_port)
		    xport == a->sin6_port)
			return;
			return;
		if (xdr == a->sin6_addr.s6_addr32[3] &&
		if (xdr == a->sin6_addr.s6_addr32[3] &&
		    xport < a->sin6_port)
		    (u16 __force)xport < (u16 __force)a->sin6_port)
			break;
			break;
		if (xdr < a->sin6_addr.s6_addr32[3])
		if ((u32 __force)xdr < (u32 __force)a->sin6_addr.s6_addr32[3])
			break;
			break;
	}
	}


@@ -280,7 +280,7 @@ void afs_merge_fs_addr6(struct afs_addr_list *alist, __be32 *xdr, u16 port)
		    xport == a->sin6_port)
		    xport == a->sin6_port)
			return;
			return;
		if (diff == 0 &&
		if (diff == 0 &&
		    xport < a->sin6_port)
		    (u16 __force)xport < (u16 __force)a->sin6_port)
			break;
			break;
		if (diff < 0)
		if (diff < 0)
			break;
			break;
+15 −12
Original line number Original line Diff line number Diff line
@@ -67,10 +67,14 @@ typedef enum {
} afs_callback_type_t;
} afs_callback_type_t;


struct afs_callback {
struct afs_callback {
	struct afs_fid		fid;		/* file identifier */
	unsigned		version;	/* Callback version */
	unsigned		version;	/* callback version */
	unsigned		expiry;		/* Time at which expires */
	unsigned		expiry;		/* time at which expires */
	afs_callback_type_t	type;		/* Type of callback */
	afs_callback_type_t	type;		/* type of callback */
};

struct afs_callback_break {
	struct afs_fid		fid;		/* File identifier */
	struct afs_callback	cb;		/* Callback details */
};
};


#define AFSCBMAX 50	/* maximum callbacks transferred per bulk op */
#define AFSCBMAX 50	/* maximum callbacks transferred per bulk op */
@@ -123,21 +127,20 @@ typedef u32 afs_access_t;
 * AFS file status information
 * AFS file status information
 */
 */
struct afs_file_status {
struct afs_file_status {
	unsigned		if_version;	/* interface version */
	u64			size;		/* file size */
#define AFS_FSTATUS_VERSION	1
	afs_dataversion_t	data_version;	/* current data version */
	time_t			mtime_client;	/* last time client changed data */
	time_t			mtime_server;	/* last time server changed data */
	unsigned		abort_code;	/* Abort if bulk-fetching this failed */


	afs_file_type_t		type;		/* file type */
	afs_file_type_t		type;		/* file type */
	unsigned		nlink;		/* link count */
	unsigned		nlink;		/* link count */
	u64			size;		/* file size */
	afs_dataversion_t	data_version;	/* current data version */
	u32			author;		/* author ID */
	u32			author;		/* author ID */
	kuid_t			owner;		/* owner ID */
	u32			owner;		/* owner ID */
	kgid_t			group;		/* group ID */
	u32			group;		/* group ID */
	afs_access_t		caller_access;	/* access rights for authenticated caller */
	afs_access_t		caller_access;	/* access rights for authenticated caller */
	afs_access_t		anon_access;	/* access rights for unauthenticated caller */
	afs_access_t		anon_access;	/* access rights for unauthenticated caller */
	umode_t			mode;		/* UNIX mode */
	umode_t			mode;		/* UNIX mode */
	time_t			mtime_client;	/* last time client changed data */
	time_t			mtime_server;	/* last time server changed data */
	s32			lock_count;	/* file lock count (0=UNLK -1=WRLCK +ve=#RDLCK */
	s32			lock_count;	/* file lock count (0=UNLK -1=WRLCK +ve=#RDLCK */
};
};


+2 −0
Original line number Original line Diff line number Diff line
@@ -31,10 +31,12 @@ enum AFS_FS_Operations {
	FSGETVOLUMEINFO		= 148,	/* AFS Get information about a volume */
	FSGETVOLUMEINFO		= 148,	/* AFS Get information about a volume */
	FSGETVOLUMESTATUS	= 149,	/* AFS Get volume status information */
	FSGETVOLUMESTATUS	= 149,	/* AFS Get volume status information */
	FSGETROOTVOLUME		= 151,	/* AFS Get root volume name */
	FSGETROOTVOLUME		= 151,	/* AFS Get root volume name */
	FSBULKSTATUS		= 155,	/* AFS Fetch multiple file statuses */
	FSSETLOCK		= 156,	/* AFS Request a file lock */
	FSSETLOCK		= 156,	/* AFS Request a file lock */
	FSEXTENDLOCK		= 157,	/* AFS Extend a file lock */
	FSEXTENDLOCK		= 157,	/* AFS Extend a file lock */
	FSRELEASELOCK		= 158,	/* AFS Release a file lock */
	FSRELEASELOCK		= 158,	/* AFS Release a file lock */
	FSLOOKUP		= 161,	/* AFS lookup file in directory */
	FSLOOKUP		= 161,	/* AFS lookup file in directory */
	FSINLINEBULKSTATUS	= 65536, /* AFS Fetch multiple file statuses with inline errors */
	FSFETCHDATA64		= 65537, /* AFS Fetch file data */
	FSFETCHDATA64		= 65537, /* AFS Fetch file data */
	FSSTOREDATA64		= 65538, /* AFS Store file data */
	FSSTOREDATA64		= 65538, /* AFS Store file data */
	FSGIVEUPALLCALLBACKS	= 65539, /* AFS Give up all outstanding callbacks on a server */
	FSGIVEUPALLCALLBACKS	= 65539, /* AFS Give up all outstanding callbacks on a server */
Loading