1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

allow larger streams using the TDB backend

(This used to be commit 8c0d756eb8)
This commit is contained in:
Andrew Tridgell 2008-05-26 14:59:58 +10:00
parent 5df9e0576e
commit c5c1b3706a
2 changed files with 11 additions and 5 deletions

View File

@ -86,7 +86,8 @@ interface xattr
/* stream data is stored in attributes with the given prefix */
const char *XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
const int XATTR_MAX_STREAM_SIZE = 0x4000;
const int XATTR_MAX_STREAM_SIZE = 0x4000;
const int XATTR_MAX_STREAM_SIZE_TDB = 0x100000;
typedef struct {
uint32 flags;

View File

@ -276,9 +276,12 @@ ssize_t pvfs_stream_write(struct pvfs_state *pvfs,
if (count == 0) {
return 0;
}
if (offset > XATTR_MAX_STREAM_SIZE) {
errno = ENOSPC;
return -1;
if (count+offset > XATTR_MAX_STREAM_SIZE) {
if (!pvfs->ea_db || count+offset > XATTR_MAX_STREAM_SIZE_TDB) {
errno = ENOSPC;
return -1;
}
}
/* we have to load the existing stream, then modify, then save */
@ -332,7 +335,9 @@ NTSTATUS pvfs_stream_truncate(struct pvfs_state *pvfs,
DATA_BLOB blob;
if (length > XATTR_MAX_STREAM_SIZE) {
return NT_STATUS_DISK_FULL;
if (!pvfs->ea_db || length > XATTR_MAX_STREAM_SIZE_TDB) {
return NT_STATUS_DISK_FULL;
}
}
/* we have to load the existing stream, then modify, then save */